Re: Summary of some postgres portability issues - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Summary of some postgres portability issues
Date
Msg-id 20080709073549.GB18930@svana.org
Whole thread Raw
In response to Summary of some postgres portability issues  ("Ken Camann" <kjcamann@gmail.com>)
Responses Re: Summary of some postgres portability issues  ("Ken Camann" <kjcamann@gmail.com>)
List pgsql-hackers
On Tue, Jul 08, 2008 at 07:01:10PM -0400, Ken Camann wrote:
> In trying to port postgres to 64-bit Windows, I've encountered a
> number of issues which may (or may not) affect other compilers.  If
> you followed the other thread, this is mostly a summary with a bit
> more details so feel free to ignore it.  Some of these may have some
> minor effects on other platforms, so they may be of interest (but I
> doubt it, since no one has noticed/complained about them yet).

Just clarifying for myself: you are mostly listing theoretical problems
here, not actual "I ran it and got regression failures" problems, right?

You spend some time arguing that long is the wrong type for lengths in
memory but since all Datums in postgres are limited to 1GB I don't
understand how this can be a practical problem since that can be stored
in an int and a long on any platform.

Mostly you seem to be noting that whatever compiler you are using is
much stricter than the other compilers used in the buildfarm. Clearly
neither icc nor sun studio find these problems on other 64-bit
platforms.

> Does that mean that
> almost every part of postgres that interacts with memory or the Datum
> type must be read very carefully to rediscover all the assumptions
> behind the code?  Unfortunately I would guess yes.

I don't understand what you mean here: the Datum type has very clear
rules about how it is stored. It is essentially opaque, but given the
typlen you have enough information to know how to copy it for example.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [WIP] patch - Collation at database level
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: Identifier case folding notes