Re: preliminary: logical column order

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>, Dave Cramer <davec(at)fastcrypt(dot)com>
Subject: Re: preliminary: logical column order
Date: 2003-11-21 08:20:59
Message-ID: 10406.1069402859@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> - The code for actually sorting the columns in attpos-order is
> duplicated a few times -- this was just done for the sake of
> convenience, I'm going to clean this up and stick it in a
> single, shared location in the new patch.

Bruce and I were chatting about that on the phone today. I think it
might be useful for TupleDescs to doubly index their contained attribute
rows --- that is, keep the existing array-indexed-by-attnum, but add
another pointer array indexed by attpos, containing only nondeleted
columns. This would be easy to build, and it'd eliminate
searching/sorting for places that had access to a TupleDesc.

> - When processing a "SELECT *", for example, the actual data
> columns are returned in the right order, but the
> RowDescription messages sent by libpq are not (i.e. they are
> sent in attnum-order, not attpos).

Easy to fix given above proposal ... although actually I am not sure why
this would occur. printtup and friends should always get a constructed
TupDesc that has no notion of deleted or renumbered columns. This may
be a symptom of a more fundamental error somewhere.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Alex 2003-11-21 11:28:58 Re: SELECT Question
Previous Message Neil Conway 2003-11-21 08:09:02 preliminary: logical column order