Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Jan Wieck
Stephan Szabo wrote: > On Tue, 14 Aug 2001, Tom Lane wrote: > > > Jan Wieck <[EMAIL PROTECTED]> writes: > > > And he who needs that kind of long term row identifiers would > > > be better off with 8-byte sequences anyway - IMNSVHO. > > > > What I need is a way to pad the struct declaration

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > What I'm asking myself all the time is "which platforms do we > support that doesn't have 8-byte integers?". Could someone > enlighten me please? Release a version that doesn't work without 8-byte ints, and I'm sure we'll find out soon enough

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Serguei Mokhov
- Original Message - From: Tom Lane <[EMAIL PROTECTED]> Sent: Tuesday, August 14, 2001 10:09 AM > typedef struct FormData_pg_sequence > { > NameData sequence_name; > int64 last_value; > #ifdef INT64_IS_BUSTED > int32 pad1; [snip] > } FormData_pg_sequence; > > This would work, I think,

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Joe Conway
> typedef struct FormData_pg_sequence > { > NameData sequence_name; > int32 last_value; > int32 increment_by; > int32 max_value; > int32 min_value; > int32 cache_value; > int32 log_cnt; > char is_cycled; > char is_called; > } FormData_pg_sequence; > > If I just change "int32" to "int64" here, all

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Stephan Szabo
On Tue, 14 Aug 2001, Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > And he who needs that kind of long term row identifiers would > > be better off with 8-byte sequences anyway - IMNSVHO. > > What I need is a way to pad the struct declaration so that it leaves > 8 bytes per

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Tom Lane
"Serguei Mokhov" <[EMAIL PROTECTED]> writes: >> This would work, I think, but my goodness it's an ugly solution. > Is anything wrong with just having two int32 per value for this case? Well, we do want it to be int64 on machines where int64 is properly defined. Or are you suggesting #ifdef INT

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Tom Lane
"Joe Conway" <[EMAIL PROTECTED]> writes: >> What I need is a way to pad the struct declaration so that it leaves >> 8 bytes per int64 column, no matter what. I thought of > What if you defined int64 as a union made up of one "long int" member and > one 8 byte char member, and then always refer t

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Neil Padgett
Tom Lane wrote: [clip] > > This would work, I think, but my goodness it's an ugly solution. > Has any hacker got a better one? > > regards, tom lane How about: #ifdef INT64_IS_BUSTED #define int64aligned(name) int32 name##_; int64 name #else #define int64aligned(name) i

Re: [HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Serguei Mokhov
- Original Message - From: Tom Lane <[EMAIL PROTECTED]> Sent: Tuesday, August 14, 2001 11:28 AM > "Serguei Mokhov" <[EMAIL PROTECTED]> writes: > >> This would work, I think, but my goodness it's an ugly solution. > > > Is anything wrong with just having two int32 per value for this ca

[HACKERS] int8 sequences --- small implementation problem

2001-08-14 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > And he who needs that kind of long term row identifiers would > be better off with 8-byte sequences anyway - IMNSVHO. Indeed. I've been looking at switching sequences to be int8, and I see just one little problem, which is to uphold the promise tha