Re: insert into ... select ... and column order

From: Tore Halset <halset(at)pvv(dot)ntnu(dot)no>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: insert into ... select ... and column order
Date: 2008-01-15 11:44:32
Message-ID: F6D7BF01-0F41-43F6-A4AA-E6747A3AEA23@pvv.ntnu.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 15, 2008, at 12:16 , Albe Laurenz wrote:

> Because the SQL standard says so.
>
> ISO/IEC 9075-2, Chapter 14.8, Syntax Rule 9:
>
> "If the <insert column list> is omitted, then an <insert column list>
> that identifies all columns of T in the ascending sequence of
> their ordinal positions within T is implicit."
>
> You want an explicit <insert column list>:
>
> INSERT INTO dest_2
> (user_id, product_id, permit_start_date, permit_end_date)
> SELECT ...

Thanks to both of you for this answer.

- Tore.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-01-15 12:16:47 Re: Segmentation fault with 8.3 FTS ISpell
Previous Message Mayuresh Nirhali 2008-01-15 11:18:52 Re: Online Oracle to Postgresql data migration