Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

Next:From: Rod TaylorDate: 2002-11-15 18:51:15
Subject: Re: Bug in pg_dump
Previous:From: Bruce MomjianDate: 2002-11-15 18:30:00
Subject: Re: new journaling system in OSX

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group