Re: How to select all columns and insert into other table - Mailing list pgsql-novice

From Jayadevan M
Subject Re: How to select all columns and insert into other table
Date
Msg-id OFBB8D044F.CB1B4C92-ON652576CE.00380D1E-652576CE.00382A7C@ibsplc.com
Whole thread Raw
In response to How to select all columns and insert into other table  (A B <gentosaker@gmail.com>)
List pgsql-novice


From:        A B <gentosaker@gmail.com>
To:        pgsql-novice@postgresql.org
Date:        02/18/2010 03:38 PM
Subject:        [NOVICE] How to select all columns and insert into other table
Sent by:        pgsql-novice-owner@postgresql.org




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?


Create a view on the source table with columns listed in the necessary order and use the view?

Regards,
Jayadevan




DISCLAIMER:


"The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."





pgsql-novice by date:

Previous
From: A B
Date:
Subject: How to select all columns and insert into other table
Next
From: dipti shah
Date:
Subject: Re: [GENERAL] Define permissions at database level