Skip site navigation (1) Skip section navigation (2)

Re: Binary data type with other output method

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Binary data type with other output method
Date: 2007-12-26 01:11:45
Message-ID: 25831.1198631505@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Dunstan <andrew(at)dunslane(dot)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 like
	CREATE DOMAIN boolint AS int CHECK (value = 0 OR value = 1)

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2007-12-26 01:36:23
Subject: Re: Binary data type with other output method
Previous:From: Andrew DunstanDate: 2007-12-25 23:15:37
Subject: Re: Binary data type with other output method

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group