Re: PQftable insufficient for primary key determination

From: mmc(at)maruska(dot)dyndns(dot)org (Michal =?iso-8859-2?q?Maru=B9ka?=)
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PQftable insufficient for primary key determination
Date: 2004-07-16 03:26:15
Message-ID: m27jt4fx9k.fsf@linux11.maruska.tin.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Wolff III <bruno(at)wolff(dot)to> writes:

> On Fri, Jul 16, 2004 at 03:38:52 +0200,
> Michal Maru?ka <mmc(at)maruska(dot)dyndns(dot)org> wrote:
>>
>>
>> Imagine i have a table A with primary key "p" and another attribute called "data":
>>
>> SELECT * from A, A, B;
>>
>> here, i will have 2 columns "data", PQftable tells me that they are from A, but
>> which of the 2 columns "p" is the primary key of the tuple (of the table A)?
>>
>>
>> Is it possible to get distinguish the 2 instances of the table A?

> You can use aliases to distinguish between two references to the same
> table in a query. Your question doesn't make a lot of sense though, since
> you haven't said which of the two copies of A you are interested in.

i don't want to force the user to distinguish 'manually', nor depend on it.

EXPLAIN VERBOSE {query} seems to provide that information, if i walk down
:varno, i *guess*. I haven't found any reference documentation on the output of
the EXPLAIN VERBOSE.

So, my question is: should i look at the code which walks that tree
(probably related to the function SendRowDescriptionMessage), or
is this code (which provides the distinguishing info) already available?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-07-16 04:33:12 Re: PQftable insufficient for primary key determination
Previous Message Bruno Wolff III 2004-07-16 03:04:42 Re: PQftable insufficient for primary key determination