Re: [PATCHES] lastval()

2005-05-10 Thread Tom Lane
"John Hansen" <[EMAIL PROTECTED]> writes: > 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. I really have a hard time seeing the argument why that condition does not mean "your applicat

Re: [PATCHES] lastval()

2005-05-10 Thread Tom Lane
Bruce Momjian writes: > Abhijit Menon-Sen wrote: >> By the way, what would lastval() do if an insert trigger inserts a row >> into a table with another serial column? > It fails, just like it would fail now if the trigger inserted into the > same table that used the trigger, or a rule. If it act

Re: [PATCHES] refactor index build

2005-05-10 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > This patch refactors away some duplicated code in the index AM build > methods: they all invoke UpdateStats() since they have computed the > number of heap tuples, so I created a function in catalog/index.c that > each AM calls. This is per earlier discu

Re: [PATCHES] lastval()

2005-05-10 Thread John Hansen
Neil Conway wrote: > Sent: Wednesday, May 11, 2005 2:13 PM > To: John Hansen > Cc: Dennis Bjorklund; [email protected] > Subject: Re: [PATCHES] lastval() > > John Hansen wrote: > > Even more so if the 'currval(void) called before nextval(seq_name)' > > error message could be supressed b

Re: [PATCHES] lastval()

2005-05-10 Thread Neil Conway
John Hansen wrote: 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. I don't think that's a good idea at all. It seems unnecessary, it complicates the definition of the operation, and worse, "0" is a valid

Re: [PATCHES] lastval()

2005-05-10 Thread John Hansen
Bruce Momjian wrote: > Sent: Wednesday, May 11, 2005 1:45 PM > To: John Hansen > Cc: Neil Conway; Dennis Bjorklund; [email protected] > Subject: Re: [PATCHES] lastval() > > John Hansen wrote: > > > > > What do people think of this idea? (Tom seems > opposed, I'm just > > > > > wonderi

Re: [PATCHES] lastval()

2005-05-10 Thread Bruce Momjian
Abhijit Menon-Sen wrote: > At 2005-05-10 23:30:05 -0400, [email protected] wrote: > > > > > By the way, what would lastval() do if an insert trigger inserts > > > a row into a table with another serial column? > > > > It fails, just like it would fail now if the trigger inserted into > > the

Re: [PATCHES] lastval()

2005-05-10 Thread Bruce Momjian
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 > > GU

Re: [PATCHES] lastval()

2005-05-10 Thread John Hansen
Bruce Momjian wrote: > Sent: Wednesday, May 11, 2005 1:27 PM > To: John Hansen > Cc: Neil Conway; Dennis Bjorklund; [email protected] > Subject: Re: [PATCHES] lastval() > > John Hansen wrote: > > Neil Conway wrote: > > > Sent: Wednesday, May 11, 2005 10:56 AM > > > To: Dennis Bjorklund

Re: [PATCHES] lastval()

2005-05-10 Thread Abhijit Menon-Sen
At 2005-05-10 23:30:05 -0400, [email protected] wrote: > > > By the way, what would lastval() do if an insert trigger inserts > > a row into a table with another serial column? > > It fails, just like it would fail now if the trigger inserted into > the same table that used the trigger, or a

Re: [PATCHES] lastval()

2005-05-10 Thread Bruce Momjian
Abhijit Menon-Sen wrote: > At 2005-05-11 10:55:37 +1000, [EMAIL PROTECTED] wrote: > > > > > Here is a small patch that implements a function lastval() [...] > > > > What do people think of this idea? (Tom seems opposed, I'm just > > wondering if there are other opinions out there.) > > For what i

Re: [PATCHES] lastval()

2005-05-10 Thread Bruce Momjian
John Hansen wrote: > Neil Conway wrote: > > Sent: Wednesday, May 11, 2005 10:56 AM > > To: Dennis Bjorklund > > Cc: [email protected] > > Subject: Re: [PATCHES] lastval() > > > > Dennis Bjorklund wrote: > > > Here is a small patch that implements a function lastval() > > that works >

Re: [PATCHES] lastval()

2005-05-10 Thread Andrew Dunstan
Abhijit Menon-Sen said: > At 2005-05-11 10:55:37 +1000, [EMAIL PROTECTED] wrote: >> >> > Here is a small patch that implements a function lastval() [...] >> >> What do people think of this idea? (Tom seems opposed, I'm just >> wondering if there are other opinions out there.) > > For what it's wort

Re: [PATCHES] lastval()

2005-05-10 Thread John Hansen
Neil Conway wrote: > Sent: Wednesday, May 11, 2005 10:56 AM > To: Dennis Bjorklund > Cc: [email protected] > 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

Re: [PATCHES] lastval()

2005-05-10 Thread Abhijit Menon-Sen
At 2005-05-11 10:55:37 +1000, [EMAIL PROTECTED] wrote: > > > Here is a small patch that implements a function lastval() [...] > > What do people think of this idea? (Tom seems opposed, I'm just > wondering if there are other opinions out there.) For what it's worth, I think it's a bad idea. In t

[PATCHES] refactor index build

2005-05-10 Thread Neil Conway
This patch refactors away some duplicated code in the index AM build methods: they all invoke UpdateStats() since they have computed the number of heap tuples, so I created a function in catalog/index.c that each AM calls. This is per earlier discussion (it was included in the GiST patches I su

Re: [PATCHES] lastval()

2005-05-10 Thread Christopher Kings-Lynne
I like the concept, but I haven't looked at the code -- I'd be happy to review the implementation, although I won't waste my time if most people are opposed to the idea itself. It'd make implementing various PHP userland functions a real breeze... Chris ---(end of broadcas

Re: [PATCHES] lastval()

2005-05-10 Thread Bruce Momjian
Neil Conway wrote: > 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 > wo

Re: [PATCHES] pgstat: reduce message header

2005-05-10 Thread Neil Conway
Neil Conway wrote: This patch reduces the size of the message header used by statistics collector messages, per recent discussion. Applied. -Neil ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "

Re: [PATCHES] cleanup: remove MemSet() casts

2005-05-10 Thread Neil Conway
Neil Conway wrote: Okay, apparently I'm the only person who doesn't like code like this :) Attached is a revised patch that doesn't make this change. Applied. -Neil ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an inde

Re: [PATCHES] lastval()

2005-05-10 Thread Joshua D. Drake
Neil Conway wrote: 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

[PATCHES] minor contrib/btree_gist cleanup

2005-05-10 Thread Neil Conway
This patch makes some minor style cleanups to contrib/btree_gist: remove the "extern" keyword for function definitions, reorganize some PG_GETARG_XXX() usage, and similar. Barring any objections, I'll apply this to HEAD tomorrow. -Neil Index: contrib/btree_gist/btree_bit.c ==

Re: [PATCHES] lastval()

2005-05-10 Thread Neil Conway
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

Re: [PATCHES] lastval()

2005-05-10 Thread Andrew Dunstan
Heikki Linnakangas wrote: On Mon, 9 May 2005, Dennis Bjorklund wrote: The thing is that I don't care how it's implemented, it's the feature itself that is more importent to decide if we want it or not. I'm sure the code can be fixed so everybody is happy it in the end, You could implement this o

Re: [PATCHES] lastval()

2005-05-10 Thread Heikki Linnakangas
On Mon, 9 May 2005, Dennis Bjorklund wrote: The thing is that I don't care how it's implemented, it's the feature itself that is more importent to decide if we want it or not. I'm sure the code can be fixed so everybody is happy it in the end, You could implement this on top of the current nextval