dbTalk Databases Forums  

[BUGS] character varying as boolean !!! help

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] character varying as boolean !!! help in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Francesco Andreozzi
 
Posts: n/a

Default [BUGS] character varying as boolean !!! help - 01-13-2005 , 05:21 AM






I think thi is a bug, I've a lot of db up with same structure and I don't have
any prioblem..
I'm using psql 7.4.2

the problem is that
i've a table

sportellounico=# \d cfp
Tabella "public.cfp"
Colonna | Tipo | Modificatori
------------------+-------------------+----------------------------------------------------------
cod_cfp | integer | not null default
nextval('public.cfp_cod_cfp_seq'::text)
cod_procedimento | bigint |
testo | character varying |


if I try to insert something it works.... but the update no....

sportellounico=# UPDATE cfp SET testo='test' AND cod_procedimento='82' where
cod_cfp='2';
ERROR: invalid input syntax for type boolean: "test"

?????????????????

so i've try to update with a boolean value, just for test and offcourse .....

sportellounico=# UPDATE cfp SET testo=true AND cod_procedimento='82' where
cod_cfp='2';
ERROR: column "testo" is of type character varying but expression is of type
boolean

I've try to drop the field and recreate... but nothing...
any suggestion?

Thankyou Francesco





--
Francesco Andreozzi
Tel. 347-3757481


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Alvaro Herrera
 
Posts: n/a

Default Re: [BUGS] character varying as boolean !!! help - 01-13-2005 , 06:58 AM






On Thu, Jan 13, 2005 at 12:18:12PM +0100, Francesco Andreozzi wrote:

Hi,

Quote:
Tabella "public.cfp"
Colonna | Tipo | Modificatori
------------------+-------------------+----------------------------------------------------------
cod_cfp | integer | not null default
nextval('public.cfp_cod_cfp_seq'::text)
cod_procedimento | bigint |
testo | character varying |


if I try to insert something it works.... but the update no....

sportellounico=# UPDATE cfp SET testo='test' AND cod_procedimento='82' where
cod_cfp='2';
ERROR: invalid input syntax for type boolean: "test"
Do you have any trigger or rule on this table?

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Oh, oh, las chicas galacianas, lo harán por las perlas,
ˇY las de Arrakis por el agua! Pero si buscas damas
Que se consuman como llamas, ˇPrueba una hija de Caladan! (Gurney Halleck)

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #3  
Old   
Richard Huxton
 
Posts: n/a

Default Re: [BUGS] character varying as boolean !!! help - 01-13-2005 , 07:49 AM



Francesco Andreozzi wrote:
Quote:
if I try to insert something it works.... but the update no....

sportellounico=# UPDATE cfp SET testo='test' AND cod_procedimento='82' where
cod_cfp='2';
ERROR: invalid input syntax for type boolean: "test"
The error message is misleading you here. You want a comma not AND
above. The parser is reading that as:

UPDATE cfp SET testo=('test' AND cod_procedimento='82')

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.