From: | "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: ALTER TABLE ( smallinto -> boolean ) ... |
Date: | 2005-09-01 22:16:38 |
Message-ID: | 20050901191422.K1044@ganymede.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-sql |
On Thu, 1 Sep 2005, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Tom Lane wrote:
>>> Sure you can. Make a SQL or PLPGSQL function that does the conversion
>>> you want and then create a cast using it.
>
>> That probably won't help him much with "values(0)":
>
> If I remember the context of the original request, it wasn't about that
> anyway, but about dealing with an existing smallint column.
Nope, actually, the original was to just convert an existing table from
using smallint->boolean, but what I'm looking at with the CREATE CAST is
to avoid reducing the # of changes that I have to make to the existing
application, so being able to auto-cast 0->'f' on an INSERT/UPDATE would
help wtih that ...
The app still needs to be fixed, but this would allow for the initial
change to be made a bit easier ...
----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2005-09-01 22:18:25 | Re: Version number in psql banner |
Previous Message | Matt Miller | 2005-09-01 22:14:55 | Re: PL/pgSQL: EXCEPTION NOSAVEPOINT |
From | Date | Subject | |
---|---|---|---|
Next Message | Joÿffffffffffe3o Carvalho | 2005-09-02 00:33:00 | queries problems |
Previous Message | Tom Lane | 2005-09-01 21:30:42 | Re: ALTER TABLE ( smallinto -> boolean ) ... |