Re: Problem importing auto-increment fields in MS Access to Postg reSQL.

Поиск
Список
Период
Сортировка
От Henshall, Stuart - WCP
Тема Re: Problem importing auto-increment fields in MS Access to Postg reSQL.
Дата
Msg-id E2870D8CE1CCD311BAF50008C71EDE8E01CA8030@MAIL_EXCHANGE
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Rich Handler"
Дата:
Сообщение: Problem importing auto-increment fields in MS Access to PostgreSQL.
Следующее
От: Rob Yampolsky
Дата:
Сообщение: RE: How to configure iodbc access to local postgres db?