[sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post

Shane Hill shanehill00 at gmail.com
Fri Apr 1 08:03:56 PST 2005


> >
> > I tried both 'public' and my username and I get the same result.
> > nada.
> 
> Does the above work for you?

it does not.  I created the exact same table that is in your example
and used your script without editing it and voila!  I get "d00d!
wtf?!?"  but no id.  wah.

my client is using 7.4.5 and does not want to go to 8.0.1.  I see that
you used 8.0.1. Could this be the problem?  have you tried your script
on a 7xx server?

I have not looked yet, but is there a way to retrieve the name of the
sequence associated with the serial column in a table?  This way I
could just hide the details of getting the seq name, call curr_val and
maintain the clean data interface I have been using.

thanks for your help, I really appreciate it.

-Shane



> 
> > > Anyhow, I'm puzzled, but I have a fix.  After
> > > you've checked whether the INSERT succeeded (you're doing that anyway,
> > > RIGHT?!? ;) just do:
> > >
> > >     SELECT currval('the_name_of_the_appropriate_seq');
> > >
> > > Not quite as convenient, and I've got a query in to the DBD::Pg dev
> > > team, but it will work.
> >
> > not convenient at all and yes I am checking for errors.  I have been
> > doing this successfully for years with the Pg module / class using:
> >
> > $result->oidStatus
> 
> I suspect that Pg gets less maintenance than DBD::Pg.
> 
> > but I switch to the DBI in an effort to "standardize" my code and my
> > system takes a steaming dump on me.  lovely.
> 
> Bummer.  It works at least one place.  Let's see about getting it
> working for you :)
> 
> Cheers,
> D
> --
> David Fetter david at fetter.org http://fetter.org/
> phone: +1 510 893 6100   mobile: +1 415 235 3778
> 
> Remember to vote!
>


More information about the SanFrancisco-pm mailing list