Re: Changing a table column datatype

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marshall(at)perilith(dot)com
Cc: psql novice <psql_novice(at)operamail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Changing a table column datatype
Date: 2003-05-13 05:08:13
Message-ID: 6070.1052802493@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

<marshall(at)perilith(dot)com> writes:
> Hmmm... Maybe I haven't explained what I'm trying to do clearly.
> I don't wish to insert new fqdn values into this table, only copy
> the contents of one column (`mycol') into another column (`mycol_new').
> Am I missing something here?

Yes. You should be using UPDATE not INSERT, viz

UPDATE mytable SET mycol_new = mycol;

INSERT is for adding new rows.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message psql novice 2003-05-13 05:12:19 Re: Changing a table column datatype
Previous Message Oliver Elphick 2003-05-13 04:59:32 Re: Changing a table column datatype