Slightly OT - Convert column in Postgres

2002-10-14 Thread Hardy Merrill
I am using Perl DBI to do this conversion, so this is somewhat related to DBI. I need to convert a column in a Postgres table from VARCHAR to INTEGER - I don't know of an easy way to do that, so I'm assuming I need to do something drastic like this in my conversion script: * create a new

Re: Slightly OT - Convert column in Postgres

2002-10-14 Thread David Wheeler
On Monday, October 14, 2002, at 11:30 AM, Hardy Merrill wrote: Is there an easier way? What am I missing? Yes, there is: PostgreSQL 7.3. It's still in beta, but should be in final release soon. It finally adds good ALTER COLUMN support. HTH, David -- David Wheeler

Re: Slightly OT - Convert column in Postgres

2002-10-14 Thread Hardy Merrill
David Wheeler [[EMAIL PROTECTED]] wrote: On Monday, October 14, 2002, at 11:30 AM, Hardy Merrill wrote: Is there an easier way? What am I missing? Yes, there is: PostgreSQL 7.3. It's still in beta, but should be in final release soon. It finally adds good ALTER COLUMN support. Are you

Re: Slightly OT - Convert column in Postgres

2002-10-14 Thread David Wheeler
On Monday, October 14, 2002, at 11:50 AM, Hardy Merrill wrote: Are you sure - I just checked the Postgres 7.3b2 docs at http://developer.postgresql.org/docs/postgres/sql-commands.html and there is no mention of an ALTER COLUMN command. Sorry, bad memory. It's DROP COLUMN that's been

Re: Slightly OT - Convert column in Postgres

2002-10-14 Thread Christopher G Tantalo
David Wheeler wrote: Sorry, bad memory. It's DROP COLUMN that's been added. This is from the HISTORY file: PostgreSQL now supports ALTER TABLE ... DROP COLUMN functionality. But what that means is that you can rename your old column, add a new column with the new data type,

Re: Slightly OT - Convert column in Postgres

2002-10-14 Thread David Wheeler
On Monday, October 14, 2002, at 11:57 AM, Christopher G Tantalo wrote: not to be a smart ass(gonna be one anyways), but after all that work, wouldnt you want to keep your new column? :) D'oh! I mean drop the old column. David -- David Wheeler AIM: