Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: table column reordering



"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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group