Re: How to implement Microsoft Access boolean (YESNO) fieldtype in PostgreSQL ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jesper K(dot) Pedersen" <jkp(at)solnet(dot)homeip(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to implement Microsoft Access boolean (YESNO) fieldtype in PostgreSQL ?
Date: 2006-01-22 20:46:11
Message-ID: 22008.1137962771@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Jesper K. Pedersen" <jkp(at)solnet(dot)homeip(dot)net> writes:
> I am have some difficulties converting the Microsoft field of type
> YESNO (which is a simple boolean true/false) to something that is
> compatible with PostgreSQL.

Assume that we have no idea what that is ;-). What is the I/O format
MSSQL uses for this datatype? Is YESNO actually the name of the type?

If the problem is that Access is looking for that specific type name,
you could probably fake it out by creating a domain:

create domain yesno as boolean;
create table foo (mycol yesno);

This will only work if the I/O format is 't' and 'f', though.
Otherwise you'll need to make the domain be over a type with
suitable I/O format (perhaps integer or text will work).

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jesper K. Pedersen 2006-01-22 21:13:28 Re: How to implement Microsoft Access boolean (YESNO)
Previous Message Jesper K. Pedersen 2006-01-22 20:13:51 How to implement Microsoft Access boolean (YESNO) fieldtype in PostgreSQL ?