(Thomas
Corell <T.Corell(a)t-online.de>)e>):
Ok, I will try to understand what is the extention they made, first look
at the function in the mysql docs did not give me a hint. Possibly I
miss at midnight the reason why I need to know this number and what
extention is handled with it. But currval(seq-name) must be similar.
The MySQL extension is the availability of auto-increment integer
fields. They're handy when you need an integer key value that's
guaranteed to be unique, but you don't care what it is. Without the
extension, you can do that by keeping a "last used ID" filed value
in a separate table and updating it every time you insert. But with
MySQL, you just go ahead and do the insert, and then ask it "Oh,
by the way, what integer value did you just assign to the auto-
increment field of the record I just inserted?"
Oh, they call that an extention. Well. There's a serial/serial8 type in
Postgres, which implicitly creates a sequence and you can use the
functions nextval() and currval(). So a definition of e.g. "cur_id
serial8 PRIMARY KEY" should handle this.