Re: I have problem with Postgres. - Mailing list pgsql-bugs

From Rod Taylor
Subject Re: I have problem with Postgres.
Date
Msg-id 1037385625.14810.68.camel@jester
Whole thread Raw
In response to I have problem with Postgres.  (Попов Андрей <andrey@cursor.ru>)
List pgsql-bugs
On Thu, 2002-11-14 at 03:40, =F0=CF=D0=CF=D7 =E1=CE=C4=D2=C5=CA wrote:
> Hi.
> I have problem with Postgres.
> I have perl script, that add 2 records in 2 tables. This script I run
> from web throught web server Apache (on FreeBSD).
> (perl version 5.005)

You would be better off using the sequence rather than trying to fetch
out max(obj_id).


select currval('object_list_obj_id_seq') AS nextvalue;

after the insert into object_list.

>=20
>     $sth =3D $dbh->prepare("select max(obj_id) from object_list");
>     $sth->execute();
>     $max =3D $sth->fetchrow;

--=20
Rod Taylor <rbt@rbt.ca>

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: new journaling system in OSX
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Get a CD