issue with select currval

From: "Alain Roger" <raf(dot)news(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: issue with select currval
Date: 2007-03-04 15:20:44
Message-ID: 75645bbb0703040720u685da530w5b13b6d6952b79ba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a table "photo" where my primary key is name "photo_id" (only serial
value is stored there).

when i type :
select currval('photo_photo_id_seq');

the answer is :
ERROR: relation "photo_photo_id_seq" does not exist

whereas the "relation photo_photo_id_seq" exists

So where is the problem ? should i specify the schema ? (schema is :
immense)

if i type :
SELECT photo_id FROM immense.photo ORDER BY photo_id DESC LIMIT 1
i get what i want (the last serial/index value used by my table)

thanks for help.

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2007-03-04 15:28:33 Re: date format
Previous Message Jim Rosenberg 2007-03-04 14:59:53 Re: Configure can't find com_err on OpenBSD for --with-krb5