Unix Technical Forum

Re: lastval()

This is a discussion on Re: lastval() within the Pgsql Patches forums, part of the PostgreSQL category; --> Bruce Momjian wrote: > Sent: Wednesday, May 11, 2005 1:27 PM > To: John Hansen > Cc: Neil Conway; ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:19 PM
John Hansen
 
Posts: n/a
Default Re: lastval()

Bruce Momjian wrote:
> Sent: Wednesday, May 11, 2005 1:27 PM
> To: John Hansen
> Cc: Neil Conway; Dennis Bjorklund; pgsql-patches@postgresql.org
> Subject: Re: [PATCHES] lastval()
>
> John Hansen wrote:
> > Neil Conway wrote:
> > > Sent: Wednesday, May 11, 2005 10:56 AM
> > > To: Dennis Bjorklund
> > > Cc: pgsql-patches@postgresql.org
> > > Subject: Re: [PATCHES] lastval()
> > >
> > > Dennis Bjorklund wrote:
> > > > Here is a small patch that implements a function lastval()
> > > that works
> > > > just like currval() except that it give the current value
> > > of the last
> > > > sequence used by nextval().
> > >
> > > What do people think of this idea? (Tom seems opposed, I'm just
> > > wondering if there are other opinions out there.)

> >
> > I'm all for it. Even more so if the 'currval(void) called before
> > nextval(seq_name)' error message could be supressed by a

> GUC variable
> > and return 0 instead.

>
> Why zero and no error?


That's the exact behaviour of the "other database's" equivalent.
Makes porting easier, and avoids hugely annoying error messages in the
logfiles.

>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman@candle.pha.pa.us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square,
> Pennsylvania 19073
>
>


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 11:19 PM
Bruce Momjian
 
Posts: n/a
Default Re: lastval()

John Hansen wrote:
> > > > What do people think of this idea? (Tom seems opposed, I'm just
> > > > wondering if there are other opinions out there.)
> > >
> > > I'm all for it. Even more so if the 'currval(void) called before
> > > nextval(seq_name)' error message could be supressed by a

> > GUC variable
> > > and return 0 instead.

> >
> > Why zero and no error?

>
> That's the exact behaviour of the "other database's" equivalent.
> Makes porting easier, and avoids hugely annoying error messages in the
> logfiles.


I think we would have to throw an error. It is hard to see how zero is
a valid return value. If you are getting too many errors in your logs,
fix the code.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:50 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com