Re: Notes about int8 sequences

From: Allan Engelhardt <allane(at)cybaea(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Notes about int8 sequences
Date: 2001-08-06 21:24:02
Message-ID: 3B6F0AF2.7EBB0E36@cybaea.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 an automatic (and silent) conversion from int8 to int4 where the range fits? The overhead of creating an int8 return value for 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-08-06 21:27:02 Use int8 for int4/int2 aggregate accumulators?
Previous Message Tom Lane 2001-08-06 20:27:39 Notes about int8 sequences