Re: [SQL] alter column from varchar(32) to varchar(255) without view re-creation

2009-05-14 Thread Emi Lu
Emi Lu wrote: PostgreSQL 8.0.15. Is there a way that I can easily alter column type from varchar(32) to varchar(255) but do not have to worry about views dependent on it? You should test it carefully and it is considered a bad practice - I'll probably get sued for recommending this :-), but yo

Re: [SQL] alter column from varchar(32) to varchar(255) without view re-creation

2009-03-19 Thread Emi Lu
PostgreSQL 8.0.15. Is there a way that I can easily alter column type from varchar(32) to varchar(255) but do not have to worry about views dependent on it? You should test it carefully and it is considered a bad practice - I'll probably get sued for recommending this :-), but you may try: SEL

Re: [SQL] alter column from varchar(32) to varchar(255) without view re-creation

2009-02-24 Thread Marcin Stępnicki
On Tue, Feb 24, 2009 at 4:27 PM, Emi Lu wrote: > Good morning, > > I am using PostgreSQL 8.0.15. > > Is there a way that I can easily alter column type from varchar(32) to > varchar(255) but do not have to worry about views dependent on it? You should test it carefully and it is considered a bad

[SQL] alter column from varchar(32) to varchar(255) without view re-creation

2009-02-24 Thread Emi Lu
Good morning, I am using PostgreSQL 8.0.15. Is there a way that I can easily alter column type from varchar(32) to varchar(255) but do not have to worry about views dependent on it? If Psql could support column alter without views' dependencies, that will be great! Thanks a lot, - Lu Ying

Re: [SQL] alter column type from boolean to char with default

2006-08-03 Thread Tom Lane
"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

Re: [SQL] alter column type from boolean to char with default

2006-08-03 Thread Andrew Hammond
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 dele

Re: [SQL] alter column type from boolean to char with default

2006-08-02 Thread Tom Lane
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), >>

Re: [SQL] alter column type from boolean to char with default

2006-08-02 Thread Rod Taylor
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 lik

Re: [SQL] alter column type from boolean to char with default doesn't work

2006-08-02 Thread Tom Lane
"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

[SQL] alter column type from boolean to char with default doesn't work

2006-08-02 Thread Markus Bertheau
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();

Re: [SQL] alter column witdh

2003-05-27 Thread Frank Bax
At 10:38 AM 5/27/03, Eric Anderson Vianet SAO wrote: >how can I alter the column width http://techdocs.postgresql.org/techdocs/updatingcolumns.php fbax=# create table tablename (columnname text); CREATE fbax=# \d tablename Table "tablename" Attribute | Type | Modifier +--+-

[SQL] Alter column

2002-07-29 Thread Thiemo Kellner
Hi, I wonder if I can alter the type of a column to a "supertype" of the original column type? Afaik, this was impossible in 7.1.3. However, I use 7.2.1. If yes, what would be the correct syntax? Cheers, Thiemo -- Thiemo Kellner Tösstalstrasse 146 CH-8400 Winterthur http://jermt.sourceforge