pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steven Hirsch <snhirsch@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Odd behavior with 'currval'
Date: Thu, 8 Feb 2018 13:45:38 -0500 (EST)
Message-ID: <alpine.DEB.2.20.1802081343110.5809@z87> (raw)
In-Reply-To: <CANu8Fix3T3np-_dLnzTPRDeDjB5LeOwX_U79DC_6YjgThKQ9jQ@mail.gmail.com>
References: <alpine.DEB.2.20.1802081050480.5809@z87>
	<CA+bJJbw-V2_gCUkbFTAn5USXZ9jtHrzh9vVMbB7mwg_yrMDyvQ@mail.gmail.com>
	<alpine.DEB.2.20.1802081243130.5809@z87>
	<de21e719-d208-3193-0788-dd39735a43c0@aklaver.com>
	<CANu8Fix3T3np-_dLnzTPRDeDjB5LeOwX_U79DC_6YjgThKQ9jQ@mail.gmail.com>

On Thu, 8 Feb 2018, Melvin Davidson wrote:

> I believe your problem is in your usage.
> In order for currval(regclass) to work, you must first do a
> SELECT nextval(regclass) in your _current transaction_!
> 
> https://www.postgresql.org/docs/9.6/static/functions-sequence.html

I AM doing that.  It is returning zero.  The code is identical to that 
used in all other tables in the schema - all of them work.  This one does 
not - unless I use the INSERT .. RETURNING ..  approach.

I suspect the weirdness with the sequence not being found is part of the 
underlying problem.


-- 




view thread (37+ messages)  latest in thread

Message-ID: <alpine.DEB.2.20.1802081343110.5809@z87>
Permalink:  ../alpine.DEB.2.20.1802081343110.5809@z87/
Also on:    postgresql.org/message-id/alpine.DEB.2.20.1802081343110.5809@z87

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: snhirsch@gmail.com
  Subject: Re: Odd behavior with 'currval'
  In-Reply-To: <alpine.DEB.2.20.1802081343110.5809@z87>
  References: <alpine.DEB.2.20.1802081050480.5809@z87> <CA+bJJbw-V2_gCUkbFTAn5USXZ9jtHrzh9vVMbB7mwg_yrMDyvQ@mail.gmail.com> <alpine.DEB.2.20.1802081243130.5809@z87> <de21e719-d208-3193-0788-dd39735a43c0@aklaver.com> <CANu8Fix3T3np-_dLnzTPRDeDjB5LeOwX_U79DC_6YjgThKQ9jQ@mail.gmail.com> <alpine.DEB.2.20.1802081343110.5809@z87>

* 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