Re: Notes about int8 sequences - Mailing list pgsql-hackers

From Allan Engelhardt
Subject Re: Notes about int8 sequences
Date
Msg-id 3B6F0AF2.7EBB0E36@cybaea.com
Whole thread Raw
In response to Notes about int8 sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> * How should one invoke nextval() and friends on such a sequence?
> Directly applying the existing convention, eg, nextval('sequencename'),
> won't work because those functions are declared to return int4.  One

I'm not really a hacker, but why couldn't you simply change nextval to return int8 in all cases?  Presumably there is
anautomatic (and silent) conversion from int8 to int4 where the range fits?  The overhead of creating an int8 return
valuefor an old-style int4 sequence (and converting it back to int4 for the INSERT/UPDATE) seems very small.
 

I'm missing something obvious again?


Allan.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Notes about int8 sequences
Next
From: Giles Lean
Date:
Subject: Re: Possible solution for LIKE optimization