Re: table column reordering

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Josh Trutwin" <josh(at)trutwins(dot)homeip(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: table column reordering
Date: 2007-09-25 01:10:37
Message-ID: 87fy13o8he.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Josh Trutwin" <josh(at)trutwins(dot)homeip(dot)net> writes:

> A couple things would have saved me lots of time and head scratching:
>
> Being able to execute COPY TABLE where table name is a view - not
> sure why this isn't possible.
>
> Being able to COPY TABLE with the result of a SELECT command where I
> can specify the column order (I think this is in 8.3, great feature)

Even in 8.1 and for as long as I can remember you could specify the columns
you wanted to include and the order they should appear in the copy command.
Try \h COPY in psql (which is similar but not quite the same as \copy)

> Being able to COPY TABLE with the result of a SELECT command where I
> can specify the column order (I think this is in 8.3, great feature)

In fact it's in 8.2 so you could get this feature now by updating to 8.2.5
instead of waiting for 8.3.

> I also just thought of another scenario, I could've created a temp
> table from a SELECT with the correct column order - wish I had
> thought of that before writing this email.

When you think of it put it in an email :)

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2007-09-25 01:18:15 Re: For index bloat: VACUUM ANALYZE vs REINDEX/CLUSTER
Previous Message Jaime Casanova 2007-09-25 00:56:14 Re: AUXILIO!!!! CONSULTA SOBRE CURSORES HELP!!! ABOUT CURSORS