Re: [HACKERS] Parser bug?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: olly(at)lfix(dot)co(dot)uk (Oliver Elphick)
Cc: olly(at)lfix(dot)co(dot)uk, hackers(at)postgreSQL(dot)org, lockhart(at)alumni(dot)caltech(dot)edu
Subject: Re: [HACKERS] Parser bug?
Date: 1998-11-24 03:42:57
Message-ID: 199811240342.WAA23922@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian wrote:
> >> I think this is a bug in 6.4:
> >>
> >> bray=> select rcname, rcsrc from pg_relcheck where rcrelid =
> >> '115404'::oid and rcrelid in (select min(rcrelid) from pg_relcheck
> >> group by rcname); ERROR: parser: Subselect has too many or too
> >> few fields.
> >>
> >> The subselect only produces one column; so I think that the
> >> error message is wrong.
> >
> >What is the GROUP BY doing?
>
> This relates to the bug in pg_dump which messes up inherited constraints.
>
> The object is to find which is the table in an inheritance hierarchy for
> which the check constraint is first defined, which must inevitably be the
> one with the lowest numbered oid. The GROUP BY operates with the aggregate
> to return the low-numbered oid for each separate rcname.

Maybe I should be clearer. You are grouping by a column that is not in
the target list. If you try the subquery on its own, it should fail
with a better error message.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-11-24 03:49:51 Re: [HACKERS] What happened to FAQ_Linux, FAQ_Irix?
Previous Message Thomas G. Lockhart 1998-11-24 03:28:39 Re: [HACKERS] cvs problem