psql use query result convert Decimal python numpy psycopg2 code example
Example: psql use query result convert Decimal python numpy psycopg2
DEC2FLOAT = psycopg2.extensions.new_type(
psycopg2.extensions.DECIMAL.values,
'DEC2FLOAT',
lambda value, curs: float(value) if value is not None else None)
psycopg2.extensions.register_type(DEC2FLOAT)