Re: Problem importing auto-increment fields in MS Access to Postg reSQL. - Mailing list pgsql-odbc

From Henshall, Stuart - WCP
Subject Re: Problem importing auto-increment fields in MS Access to Postg reSQL.
Date
Msg-id E2870D8CE1CCD311BAF50008C71EDE8E01CA8030@MAIL_EXCHANGE
Whole thread Raw
List pgsql-odbc
Hello,
    Auto-increment type doesn't exist in pgsql per se. However there is
a very similar serial type. This type is basically int4 with a default value
of the nextval of a sequence (automatically generated by seriasl type).
Because this is a default value, the record must be inserted before the
value is generated. To get around this I have ODBC pass-through queries set
to select the nextval of the sequence (eg select nextval('"jobs_id_seq"');)
I then would INSERT INTO jobs (id) VALUES (<whatever the value was>); I can
then open a recordset that references this value, or add as a where
condition on a form opening etc...  (I have these two SQL statements
basically together in a function that returns the value of the ID).
hmm, maybe this should be on -general, oh well
hope this was useful,
- Stuart
P.S. As a sidenote PG 7.1 has been released.


pgsql-odbc by date:

Previous
From: "Rich Handler"
Date:
Subject: Problem importing auto-increment fields in MS Access to PostgreSQL.
Next
From: Rob Yampolsky
Date:
Subject: RE: How to configure iodbc access to local postgres db?