Tom Lane wrote:
Rod Taylor [EMAIL PROTECTED] writes:
On Wed, 2006-08-02 at 09:19 -0400, Tom Lane wrote:
Hmm ... the way I would have expected to work is
alter table posts
alter column deleted drop default,
alter column deleted type char(1)
using (case when deleted then 't' else 'f'
Andrew Hammond [EMAIL PROTECTED] writes:
Alternatively, you already have the USING clause to tell you how to
alter the data. How about using it to alter the default as well?
The reasons not to do that are already set forth in the ALTER TABLE
man page.
regards, tom lane
Hi,
I basically want to change a boolean column to char. The boolean
column has a default of true. The char column should have 'f' for
false and 't' for true. I think that an SQL statement like the
following should work, but it doesn't:
blog= select version();
Markus Bertheau [EMAIL PROTECTED] writes:
I basically want to change a boolean column to char. The boolean
column has a default of true. The char column should have 'f' for
false and 't' for true. I think that an SQL statement like the
following should work, but it doesn't:
Hmm ... the way I
On Wed, 2006-08-02 at 09:19 -0400, Tom Lane wrote:
Markus Bertheau [EMAIL PROTECTED] writes:
I basically want to change a boolean column to char. The boolean
column has a default of true. The char column should have 'f' for
false and 't' for true. I think that an SQL statement like the
Rod Taylor [EMAIL PROTECTED] writes:
On Wed, 2006-08-02 at 09:19 -0400, Tom Lane wrote:
Hmm ... the way I would have expected to work is
alter table posts
alter column deleted drop default,
alter column deleted type char(1)
using (case when deleted then 't' else 'f' end),
alter column