Re: Functional dependencies and GROUP BY

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Alex Hunsaker <badalex(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Functional dependencies and GROUP BY
Date: 2010-09-05 15:31:16
Message-ID: AANLkTi=qFrH4vanBEBgY9WCa8aERdyLLTN=EPSvOLJ+-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 September 2010 16:15, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
>> On 7 August 2010 03:51, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I was testing out this feature this morning and discovered that the
>> results may be non-deterministic if the PK is deferrable.
>
> Good point.
>
>> The original version of the patch had that check in it, but it
>> vanished from the final committed version. Was that just an oversight,
>> or an intentional change?
>
> I don't recall having thought about it one way or the other.  What did
> the check look like?
>

Well originally it was searching indexes rather than constraints, and
funcdeps_check_pk() included the following check:

if (!indexStruct->indisprimary || !indexStruct->indimmediate)
continue;

Now its looping over pg_constraint entries, so I guess anything wtih
con->condeferrable == true should be ignored.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-05 15:35:45 Re: Functional dependencies and GROUP BY
Previous Message Tom Lane 2010-09-05 15:15:33 Re: Functional dependencies and GROUP BY