[sf-perl] Last Insert ID
josh at agliodbs.com
Fri Apr 1 10:20:50 PST 2005
> yup, that was one of the ways I contemplated doing this. But you are
> hosed if Pg starts auto naming things differently.
That's not too likely at this point. In older versions, it could hose you
because we had a 32-character identifier limit, so sometimes sequence names
would get truncated.
The other alternative is to manually name your sequences. That declaration
CREATE SEQUENCE users_seq;
user_id INT NOT NULL PRIMARY KEY DEFAULT nextval('users_seq'),
... instead of ...
user_id SERIAL PRIMARY KEY
And is it just me, or did the other SFPUG just sort of annex the SFPerl
Aglio Database Solutions
More information about the SanFrancisco-pm