Re: Beta time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Beta time
Date: 2001-09-19 05:07:57
Message-ID: 27363.1000876077@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> Attached is the CONSTR_PRIMARY switch block from command.c. I've marked the
> problem test with '@@'.

Hmmm .... this code has got a number of problems, but I don't see why
*that* would fail. Anyone?

What I do see:

1. Should not "break" out of loop over indexes after detecting a
matching non-primary-key index. This allows detection of the NOTICE
condition to distract you from detecting the ERROR condition on a
later index. I'd suggest issuing the NOTICE inside the loop, actually,
and not breaking at all. (See also #4)

2. What's with the "if (keyno > 0)"? That breaks detection of
everything on indexes on system columns, eg OID. (Of course, the
"rel_attrs[keyno - 1]" reference doesn't work for system columns,
but sticking your head in the sand is no answer.)

3. pfree'ing iname at the bottom doesn't strike me as a good
idea; isn't that possibly part of your input querytree?

4. If you're going to be so pedantic as to issue a warning notice about
a duplicate non-primary index, it'd be polite to give the name of that
index. Else how shall I know which index you think I should drop?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-09-19 05:32:13 Re: Beta time
Previous Message Tom Lane 2001-09-19 04:14:34 Re: x = NULL