I wrote a function that takes a boolean parameter and returns int2.
From: Valerio Santinelli [SMTP:tanis(at)mediacom(dot)it]
Sent: Wednesday, February 24, 1999 1:10 PM
To: Michael Davis
Subject: Re: [GENERAL] Checkboxes on MSAccess and PostgreSQL
That's the same thing I did today to get rid of the boolean problem.
got another one ;)
I want to use my data contained in the table filled with boolean
stuff and I'd
like to convert all the booleans to int2. I know there's a way to do
doing something like:
INSERT INTO mynewtable SELECT field1, field2, (booleanfield='t'),
but "(booleanfield='t')" gives another boolean value. I think I
it into an int2 but I don't know how to do that since there isn't a
liek a bool_to_int2.
Any ideas ?
Michael Davis wrote:
> I defined my Access boolean fields as int2 in Postgres. This, in
> combination with removing the "Bools as Char" flag in the ODBC
> appears to work. However, I have not been able to much testing.
> -----Original Message-----
> From: Valerio Santinelli [SMTP:tanis(at)mediacom(dot)it]
> Sent: Wednesday, February 24, 1999 4:25 AM
> To: sferac(at)bo(dot)nettuno(dot)it
> Cc: pgsql-interfaces(at)postgreSQL(dot)org;
> Subject: Re: [GENERAL] Checkboxes on MSAccess and
> Jose' Soares wrote:
> > Valerio Santinelli wrote:
> > >
> > > First of all.. thanks to everybody for helping me out
> > > "sequence" stuff. :)
> > >
> > > I've got another questions for you dudes. When using
> in a
> > > Form written in MSAccess that's related to a table in
> > > PostgreSQL database, if I simply turn its status from
ON to OFF
> it works
> > > fine, while if i'm doing the opposite it won't work.
> > >
> > > I noticed that when exporting the table from MSAccess
> PostgreSQL the
> > > "yes/no" fields all became char(1) and not boolean..
> could be
> > > the problem.
> > >
> > > I also noticed from the logs that when updating the
> ON to
> > > OFF the UPDATE goes out with something like
> > > I'm not sure it should use the "'" since it's more
> numerical, no
> > > ?
> > >
> > > Thanks again,
> > >
> > > Valerio Santinelli
> > > tanis(at)mediacom(dot)it
> > You have to uncheck "Bools as Char" on Advanced options
> > Data Source Administrator
> > and then you have to create an operator for bool=int4
> > /* M$Access tratta il valore booleano come un intero
> > mentre invece PostgreSQL lo tratta come una stringa:
> > 'true','t','1','y','yes','false','f','0','n','no'
> > Questo script crea l'operatore = e implicitamente <>
per bool e
> > per compatibilita' con M$Access.
> > */
> > drop operator = (bool,int4);
> > drop function MsAccessBool(bool,int4);
> > create function MsAccessBool(bool,int4)
> > returns bool
> > as ''
> > language 'internal';
> > create operator = (
> > leftarg=bool,
> > rightarg=int4,
> > procedure=MsAccessBool,
> > commutator='=',
> > negator='<>',
> > restrict=eqsel,
> > join=eqjoinsel
> > );
> Some time ago I got this message and I tried to make
> with my
> database, but there's been no way to do that. First of
> "DROP MsAccessBool" my PostgreSQL database engine reports
> can't be dropped because it's an internal (built-in).
> Second, it seems to replace it by creating the function (i
> know how it
> could if the function already exists..) but then again
> updating a
> record in a table with booleans it simply doesn't let me
> desperately seeking help now.. I don't really know how to
> Thanks in advance
> Valerio Santinelli
Valerio Santinelli a.k.a. TANiS
pgsql-general by date
|Next:||From: The Hermit Hacker||Date: 1999-02-24 20:39:12|
|Subject: Re: [GENERAL] ISP with PostgreSQL|
|Previous:||From: Valerio Santinelli||Date: 1999-02-24 20:09:42|
|Subject: Re: [GENERAL] Checkboxes on MSAccess and PostgreSQL|