pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc G. Fournier <scrappy@postgresql.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Marc G. Fournier <scrappy@postgresql.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: ALTER TABLE ( smallinto -> boolean ) ...
Date: Thu, 1 Sep 2005 19:16:38 -0300 (ADT)
Message-ID: <20050901191422.K1044@ganymede.hub.org> (raw)
In-Reply-To: <6793.1125610242@sss.pgh.pa.us>
References: <20050829201253.X1044@ganymede.hub.org>
	<15013.1125359379@sss.pgh.pa.us>
	<20050901174341.N1044@ganymede.hub.org>
	<6399.1125608205@sss.pgh.pa.us>
	<4317713C.10808@dunslane.net>
	<6793.1125610242@sss.pgh.pa.us>

On Thu, 1 Sep 2005, Tom Lane wrote:

> Andrew Dunstan <andrew@dunslane.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@hub.org           Yahoo!: yscrappy              ICQ: 7615664



view thread (13+ messages)

Message-ID: <20050901191422.K1044@ganymede.hub.org>
Permalink:  ../20050901191422.K1044@ganymede.hub.org/
Also on:    postgresql.org/message-id/20050901191422.K1044@ganymede.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scrappy@postgresql.org, tgl@sss.pgh.pa.us, andrew@dunslane.net, pgsql-hackers@postgresql.org
  Subject: Re: ALTER TABLE ( smallinto -> boolean ) ...
  In-Reply-To: <20050901191422.K1044@ganymede.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox