column name order matters in insert into foo from bar

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: column name order matters in insert into foo from bar
Date: 2008-12-04 13:15:55
Message-ID: 2f4958ff0812040515j67112cdejdc54f29365805a46@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hey,

it looks , as if when I have two tables, say
create table foo(
a int,
b varchar,
c float
);

and :

create table bar(
b varchar,
a int,
c float
);

migration of data from one to the other using

insert into foo select * from bar; will fail.
How can I walk around that please ?

--
GJ

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2008-12-04 13:18:07 Re: column name order matters in insert into foo from bar
Previous Message Grzegorz Jaśkiewicz 2008-12-04 11:39:41 Re: psql verbose mode