Re: logical column ordering

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Phil Currier <pcurrier(at)gmail(dot)com>
Subject: Re: logical column ordering
Date: 2014-12-09 23:19:42
Message-ID: 5487838E.7030805@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/09/2014 09:41 AM, Alvaro Herrera wrote:
> The first thing where this matters is tuple descriptor expansion in
> parse analysis; at this stage, things such as "*" (in "select *") are
> turned into a target list, which must be sorted according to attlognum.
> To achieve this I added a new routine to tupledescs,

The two other major cases are:

INSERT INTO table SELECT|VALUES ...

COPY table FROM|TO ...

... although copy should just be a subclass of SELECT.

Question on COPY, though: there's reasons why people would want COPY to
dump in either physical or logical order. If you're doing COPY to
create CSV files for output, then you want the columns in logical order.
If you're doing COPY for pg_dump, then you want them in physical order
for faster dump/reload. So we're almost certainly going to need to have
an option for COPY.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-12-09 23:31:34 Re: Proposal : REINDEX SCHEMA
Previous Message Jim Nasby 2014-12-09 23:06:04 Re: operator does not exist: character varying[] <> character[]