pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
Cc: Marcin Krawczyk <jankes.mk@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: error codes
Date: Thu, 17 Apr 2008 18:51:12 +0800
Message-ID: <48072BA0.1050503@postnewspapers.com.au> (raw)
In-Reply-To: <480729C4.7040802@postnewspapers.com.au>
References: <95f6bf9b0804170123w271df42er3b377c1b9a3f0244@mail.gmail.com>
	<480729C4.7040802@postnewspapers.com.au>

Craig Ringer wrote:
> Marcin Krawczyk wrote:
>> Hi guys. Does anyone know the error code for '/currval of sequence * is
>> not yet defined in this session/' error ? Is there one at all?
> 
> A quick JDBC test program shows:
> 
> ERROR: currval of sequence "customer_id_seq" is not yet defined in this
> session (SQLState: 55000)

I've just realised I've been doing this a stupid way without thinking
about it. Unsurprisingly it turns out that no Java/JDBC snippets are
required. The much, much easier way to find the error code:

$ psql

... blah blah blah ...

test=# \set VERBOSITY verbose
test=# select currval('test_seq');
ERROR:  55000: currval of sequence "test_seq" is not yet defined in this
session
LOCATION:  currval_oid, sequence.c:644

In retrospect it seems kind of obvious - "surely psql must have way to
show this information, maybe I should look at the manual....".

--
Craig Ringer



view thread (3+ messages)

Message-ID: <48072BA0.1050503@postnewspapers.com.au>
Permalink:  ../48072BA0.1050503@postnewspapers.com.au/
Also on:    postgresql.org/message-id/48072BA0.1050503@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: craig@postnewspapers.com.au, jankes.mk@gmail.com
  Subject: Re: error codes
  In-Reply-To: <48072BA0.1050503@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox