Re: logical column order and physical column order

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical column order and physical column order
Date: 2013-11-05 14:22:01
Message-ID: 20131105142201.GG5809@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Leonardo Francalanci 2013-11-05 14:28:52 Re: Fast insertion indexes: why no developments
Previous Message Michael Paquier 2013-11-05 14:15:13 Re: [PATCH] configure: add git describe output to PG_VERSION when building a git tree