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

RES: Alter column...using failure under 9.0.4

From: "Edson Carlos Ericksson Richter" <richter(at)simkorp(dot)com(dot)br>
To: <pgsql-general(at)postgresql(dot)org>,<pgsql-hackers(at)postgresql(dot)org>
Subject: RES: Alter column...using failure under 9.0.4
Date: 2011-09-25 16:19:19
Message-ID: 001701cc7b9e$e3aa9bc0$aaffd340$@com.br (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
That's it: a check constraint I was not aware of...
Thanks!

Edson

-----Mensagem original-----
De: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] Em nome de Tom Lane
Enviada em: domingo, 25 de setembro de 2011 13:04
Para: pgsql-general(at)postgresql(dot)org; pgsql-hackers(at)postgresql(dot)org
Assunto: Re: [GENERAL] Alter column...using failure under 9.0.4 

=?iso-8859-1?Q?Bj=F6rn_H=E4user?= <bjoernhaeuser(at)gmail(dot)com> writes:
> Am 25.09.2011 um 17:17 schrieb Edson Carlos Ericksson Richter:
>> alter table usuario alter column ativo type smallint using (case when 
>> ativo then 1 else 0 end);
>> ERROR:  argument of IS FALSE must be type boolean, not type smallint

> you could check for indices or something like that.

Yeah, looks like expression index or CHECK constraint or something similar
that includes "ativo IS FALSE".

Note to hackers: I wonder whether we could make this a bit more
user-friendly by providing a CONTEXT line that shows which table property
we're trying to convert.

			regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


In response to

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2011-09-25 16:22:03
Subject: Re: [v9.2] Fix Leaky View Problem
Previous:From: Tom LaneDate: 2011-09-25 16:04:29
Subject: Re: Alter column...using failure under 9.0.4

pgsql-general by date

Next:From: Tom LaneDate: 2011-09-25 16:25:21
Subject: Re: (another ;-)) PostgreSQL-derived project ...
Previous:From: Tom LaneDate: 2011-09-25 16:08:46
Subject: Re: New feature: accumulative functions.

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