Re: [GENERAL] Single character bitfields

2008-08-22 Thread Decibel!
On Aug 21, 2008, at 3:45 AM, Tomasz Ostrowski wrote: - one byte "char" (with quotes), but it is a non standard, integral type, will cause interface problems and I don't know if it will not be deprecated some time. It's used in the catalogs, so I'd say the odds of it getting replaced anytime

Re: [GENERAL] Single character bitfields

2008-08-21 Thread Andrew Maclean
-Original Message- From: Bill Moran [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 August 2008 22:36 To: [EMAIL PROTECTED] Cc: Andrew Maclean; General Subject: Re: [GENERAL] Single character bitfields In response to "Andrew Maclean" <[EMAIL PROTECTED]>: > I have a l

Re: [GENERAL] Single character bitfields

2008-08-21 Thread Andrew Maclean
-Original Message- From: Tomasz Ostrowski [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 August 2008 18:46 To: [EMAIL PROTECTED] Cc: General Subject: Re: Single character bitfields On 2008-08-21 05:29, Andrew Maclean wrote: > Is char(1) one byte in size? No. It will also depend on databas

Re: [GENERAL] Single character bitfields

2008-08-21 Thread Bill Moran
In response to "Andrew Maclean" <[EMAIL PROTECTED]>: > I have a large database and I want to have several fields (among many) > that are single character fields (in fact they are bitfields). > > 1) Is char(1) the most efficient way to store these fields? If not > what is better? > 2) I need to te

Re: [GENERAL] Single character bitfields

2008-08-21 Thread Tomasz Ostrowski
On 2008-08-21 05:29, Andrew Maclean wrote: > Is char(1) one byte in size? No. It will also depend on database encoding, etc. I think you should go with smallint, which is exactly 2 bytes. You'll have 15 bits of storage (16 if you'd want to implement the special case of minus sign). IMHO the onl

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Andrew Maclean
On Thu, Aug 21, 2008 at 12:56 PM, Joshua Drake <[EMAIL PROTECTED]> wrote: > On Thu, 21 Aug 2008 12:40:29 +1000 > "Andrew Maclean" <[EMAIL PROTECTED]> wrote: > >> I have a large database and I want to have several fields (among many) >> that are single character fields (in fact they are bitfields).

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > Out of curiosity, does postgres collapse multiple boolean columns to a > bitfield internally? No. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Ben
On Aug 20, 2008, at 7:56 PM, Joshua Drake wrote: I have a large database and I want to have several fields (among many) that are single character fields (in fact they are bitfields). boolean? Out of curiosity, does postgres collapse multiple boolean columns to a bitfield internally? In o

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Joshua Drake
On Thu, 21 Aug 2008 12:40:29 +1000 "Andrew Maclean" <[EMAIL PROTECTED]> wrote: > I have a large database and I want to have several fields (among many) > that are single character fields (in fact they are bitfields). > > 1) Is char(1) the most efficient way to store these fields? If not > what is