Re: Binary data type with other output method - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Binary data type with other output method
Date
Msg-id 25831.1198631505@sss.pgh.pa.us
Whole thread Raw
In response to Re: Binary data type with other output method  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Binary data type with other output method  (Andrew Dunstan <andrew@dunslane.net>)
Re: Binary data type with other output method  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> I think all you need to do it this:
> Take the code for boolout() in src/backend/utils/adt/bool.c, adjust it 
> and and make it a new function boolout2. Use pgxs to make it a loadable 
> module.
> Then load it and adjust the catalog entry for the bool type to use 
> boolout2 instead of boolout.

Then start fixing pg_dump, psql, and every other bit of client-side code
that expects the boolean columns in the system catalogs to read out as
't'/'f' ...

I think you'd really need a separate type.  But have you considered
something simple likeCREATE DOMAIN boolint AS int CHECK (value = 0 OR value = 1)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Binary data type with other output method
Next
From: Andrew Dunstan
Date:
Subject: Re: Binary data type with other output method