PostgreSQL serials in MS-Access are writable, but they are supposed to be read-only

From: "Antti Toivanen" <antti(dot)toivanen(at)telemerkki(dot)fi>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: PostgreSQL serials in MS-Access are writable, but they are supposed to be read-only
Date: 2002-05-29 16:19:09
Message-ID: 91DA99B1BB1FD211A1910008C724C36E01E9A8@TMSRV01
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

-----Original Message-----
From: Antti Toivanen [mailto:antti(dot)toivanen(at)telemerkki(dot)fi]
Sent: 29 May 2002 17:02
To: Dave Page
Subject: RE: [pgadmin-support] Migration from MS Sql server using the
plug-in

Hi again!

Okay, I did as you told me to.

Basicly the PostgreSQL's serial_col now works as supposed.

But I ran to a another problem, altough it is not related to the
Migration plugin nor pgAdmin.

The MS-Access doesn't regognize the ID field as a Auto_Increment.

For example: this is problem if I want to copy a record from table A to
table B with ADO (or DAO), field by field.

If the procedure doesn't know which fields are writable and which arent
(the Auto_Increment from PostgreSQL is writable), it might try to create
a duplicated key since it copies it from the old record.

Do you know a fully Access compatible way to handle this without
possible code modifications, or can you address it for those who can
make such a way possible?

Regards, Antti

-----Original Message-----
From: Antti Toivanen [mailto:antti(dot)toivanen(at)telemerkki(dot)fi]
Sent: 29 May 2002 12:15
To: pgadmin-support(at)postgresql(dot)org
Subject: [pgadmin-support] Migration from MS Sql server using the
plug-in

It doesnt import identity fields as serials, and thus is not usable for
databases using auto_increment.

It is usable because when it has finished it is trivial to do something
like:

SELECT max(serial_col) FROM tablename;

CREATE SEQUENCE serial_col_id START <result of previous query + 1>;

ALTER TABLE tablename ALTER COLUMN serial_col SET DEFAULT
nextval('serial_col_id');

CREATE UNIQUE INDEX serial_col_idx ON tablename (serial_col);

Regards, Dave.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2002-05-30 04:57:00 Re: int8 becames string in BDE :-(
Previous Message Laszlo Tibor 2002-05-29 15:41:12 Re: int8 becames string in BDE :-(