Re: contrib/fixchar (Was: Large databases, performance) - Mailing list pgsql-hackers

From Giles Lean
Subject Re: contrib/fixchar (Was: Large databases, performance)
Date
Msg-id 20829.1034376888@nemeton.com.au
Whole thread Raw
In response to Re: contrib/fixchar (Was: Large databases, performance)  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Responses Re: contrib/fixchar (Was: Large databases, performance)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: contrib/fixchar (Was: Large databases, performance)  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
List pgsql-hackers
> Well, this is not related to postgresql exactly but to summerise the
> problem, with libc patch PHCO_19090 or compatible upwards, on
> HP-UX11, isspace does not work correctly if input value is >127.

o isspace() and such are defined in the standards to operate on characters
o for historic C reasons, 'char' is widened to 'int' in function calls
o it is platform dependent whether 'char' is a signed or unsigned type

If your platform has signed 'char' (as HP-UX does on PA-RISC) and you
pass a value that is negative it will be sign extended when converted
to 'int', and may be outside the range of values for which isspace()
is defined.

Portable code uses 'unsigned char' when using ctype.h features, even
though for many platforms where 'char' is an unsigned type it's not
necessary for correct functioning.

I don't see any isspace() or similar in the code though, so I'm not
sure why this issue is being raised?

Regards,

Giles


pgsql-hackers by date:

Previous
From: Mike Mascari
Date:
Subject: Re: MySQL vs PostgreSQL.
Next
From: Jeff Davis
Date:
Subject: Re: MySQL vs PostgreSQL.