Re: I have problem with Postgres.

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Попов Андрей <andrey(at)cursor(dot)ru>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: I have problem with Postgres.
Date: 2002-11-15 18:40:26
Message-ID: 1037385625.14810.68.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 2002-11-14 at 03:40, Попов Андрей 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.

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

--
Rod Taylor <rbt(at)rbt(dot)ca>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Rod Taylor 2002-11-15 18:51:15 Re: Bug in pg_dump
Previous Message Bruce Momjian 2002-11-15 18:30:00 Re: new journaling system in OSX