How to select all columns and insert into other table

From: A B <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to select all columns and insert into other table
Date: 2010-02-18 10:10:32
Message-ID: dbbf25901002180210n4dc9d668t635fab34fc6cedba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello.

If tableA and tableB have the same columns but in differrent order

Is there a way to get

INSERT INTO tableA SELECT * FROM tableB LIMIT 1;

to work, that is, get the value in column X to be placed in the
corresponding column in tableA without listing all the columns?

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jayadevan M 2010-02-18 10:13:28 Re: How to select all columns and insert into other table
Previous Message Richard Huxton 2010-02-18 10:04:50 Re: Define permissions at database level