1

When I define a column using sqlalchemy I use the float type with syntax like

from sqlalchemy import Column, Float
new_column_name = Column('new_column_name',Float,nullable=True)

This seems to default to a double in postgres, if I wanted a real, is this done through the precision input, or a different type?

1 Answer 1

4

From here:

https://docs.sqlalchemy.org/en/13/core/type_basics.html?highlight=data%20type#generic-types

class sqlalchemy.types.REAL(precision=None, asdecimal=False, decimal_return_scale=None)

    Bases: sqlalchemy.types.Float

    The SQL REAL type.
Sign up to request clarification or add additional context in comments.

1 Comment

Ah, that's clear, sorry to have missed that and thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.