at the moment Postgres table reflection isnt doing any check for a SERIAL
or sequence value when it reflects. The usage of a sequence for Postgres
is done in an ad-hoc fashion upon an insert, i.e.
going to insert a row -->
primary key column has no value ? ->
column is an integer type ? ->
no default/explicit sequence set ? ->
execsql "select nexval('%s_%s_seq')" % (column.table.name,
column.name)
a similar set of logic takes effect when postgres creates a table, i.e. if
its an integer primary key column with no defaults set, it specifies
SERIAL in the create statement.
If you can show me how to determine "SERIAL" status when reflecting a
table via the information_schema, we can work on a more explicit way to
indicate the SERIAL flag on a column.
Nicholas Wieland wrote:
> Hi *,
> I'm not able to find a way to know if a column is a sequence or not in
> an autoloaded table
> I've tried something like isinstance (column, Sequence) but it doesn't
> seem to work, and also with introspection I can't find any useful
> information: the column is
>
> Column('id',PGInteger(),key='id',primary_key=True,nullable=False,hidden=False,default=None)
>
> My application uses a lot of introspection, I need to differentiate
> serials and integers ...
> Is there a way to find out the information I need ?
>
> TIA,
> ngw
>
> p.s. Probably I've read something on the argument on the list,
> unfortunately I'm not able to find the mail :/
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
> _______________________________________________
> Sqlalchemy-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users