On Jun 8, 11:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello.  I am receiving the error:
>
> sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt 'INSERT
> INTO workorderlines (workorderlines_rowid) VALUES (%
> (workorderlines_rowid)s)' {'workorderlines_rowid':
> Sequence('workorderlines_rowid_seq',start=None,increment=None,optional=False)}
>
> running the following simplified version of what I am working with:
>
> from sqlalchemy import *
>
> db = create_engine('postgres://[EMAIL PROTECTED]:5432/fleettest')
>
> db.echo = True
>
> metadata = BoundMetaData(db)
>
> workorderlines_table = Table('workorderlines', metadata,
>         Column('workorderlines_rowid', Numeric(10,0),
> default=Sequence('workorderlines_rowid_seq')),
>         PrimaryKeyConstraint('workorderlines_rowid'),
> )

the "default" keyword argument is for literal values or python
functions.  to use Sequence:

t = Table('foo', metadata, Column('id', Integer,
Sequence('my_sequence'), primary_key=True))

the postgres dialect currently has the restriction that PK values must
go in as explicitly inserted values, as opposed to a default firing
off implicitly on the PG side.  this is documented here:
http://www.sqlalchemy.org/docs/metadata.html#metadata_defaults_passive_postgres



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to