Re: logical column order and physical column order - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: logical column order and physical column order
Date
Msg-id 20131105142201.GG5809@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: logical column order and physical column order  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
David Rowley escribió:

> In this case how does Postgresql know that attnum 3 is the 2nd user column
> in that table? Unless I have misunderstood something then there must be
> some logic in there to skip dropped columns and if so then could it not
> just grab the "attphynum" at that location? then just modify the 1-5 places
> listed above to sort on attlognum?

During parse analysis, those columns obtained from pg_attribute are
transformed to target list entries; they travel through the parser and
executor in that representation, and TupleDescs are constructed from
those lists.  Making that works correctly needs some more code than just
sorting on attlognum.  There are some other messy parts like handling
composite types when passed to functions, COPY, and some other things I
don't remember.  Did you look at the places my patch touches?

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH] configure: add git describe output to PG_VERSION when building a git tree
Next
From: Leonardo Francalanci
Date:
Subject: Re: Fast insertion indexes: why no developments