Re:

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Cc: tlange(at)gwdg(dot)de, pgsql-sql(at)postgresql(dot)org
Subject: Re:
Date: 2010-05-21 08:15:37
Message-ID: 4BF64129.10604@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 21/05/2010 9:56 AM, Richard Broersma wrote:
> On Thu, May 20, 2010 at 5:52 PM,<tlange(at)gwdg(dot)de> wrote:
>
>> I'm new to triggers in PostgreSQL. I have to create a trigger on insert to
>> increment a sequence to overcome MS-Access' limitation in acknowledging
>> serial "datatype".
>
> Uh? Access doesn't need to acknowledge the serial datatype.
> At-least in recent versions auto increment is recognized by MS-Access
> just fine (I'm guessing this is due to the Return clause which the
> ODBC driver automatically calls).

Really?

I had problems with Access complaining that the object it just inserted
had vanished, because the primary key Access had in memory (null) didn't
match what was stored (the generated PK). I had to fetch the next value
in the PK sequence manually and store it in Access's record before
inserting it to work around this.

I wouldn't be surprised if this actually turned out to just require some
bizarre ODBC driver parameter change, but I never figured it out and I
couldn't find any info about it on the 'net.

For the original poster: I posted some information about this at the
time I was working on it, so search the archives of this list for MS Access.

I eventually ditched Access entirely as the user who was demanding the
use of MS Access relented (phew!), so I put together a simple web-app to
do what they wanted in a day. Hopefully I'll never need to go near ODBC
again, because it's a truly "special" way to talk to PostgreSQL.

--
Craig Ringer

In response to

  • Re: at 2010-05-21 01:56:39 from Richard Broersma

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma 2010-05-21 14:47:45 Re:
Previous Message tlange 2010-05-21 07:35:20 Re: sorry, now with subject... trigger & nextval(seq)