dbTalk Databases Forums  

Re: [BUGS] contrib/intarray/_int_gist.c

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] contrib/intarray/_int_gist.c in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Qingqing Zhou
 
Posts: n/a

Default Re: [BUGS] contrib/intarray/_int_gist.c - 04-05-2006 , 06:43 AM







<jw.pgsql (AT) sduept (DOT) com> wrote
Quote:
In "g_int_compress" :


int *dr;
...
memmove((void *) &dr[cand - 1], (void *) &dr[cand + 1], (len - cand -
1) * sizeof(int));

Should be

int32 *dr;
...
memmove((void *) &dr[cand - 1], (void *) &dr[cand + 1], (len - cand -
1) * sizeof(int32));

AFAICS, int32 and int are exactly the same thing in PostgreSQL. For the
machine int is not 32 bits long, PostgreSQL won't even run.

Regards,
Qingqing



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] contrib/intarray/_int_gist.c - 04-05-2006 , 10:19 AM






"Qingqing Zhou" <zhouqq (AT) cs (DOT) toronto.edu> writes:
Quote:
AFAICS, int32 and int are exactly the same thing in PostgreSQL. For the
machine int is not 32 bits long, PostgreSQL won't even run.
Ideally we should operate correctly if "int" is 64 bits. In practice
I agree that making contrib work would be mighty far down the list of
things to fix...

It appears to me that the current de-facto standard for C on 64-bit
machines is
char 8 bits
short 16 bits
int 32 bits
long 64 bits
Promoting "int" to 64 bits has a big problem: you have to drop one of
the widths entirely, because there is no other basic type allowed by
C. (int16_t and the others are only typedefs not new basic types.)
So I'm not really expecting to see int = 64 bits any time soon.

As for the other direction (int = 16 bits), there's no real hope of
running Postgres on a 16-bit machine anyway :-(

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.