From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Michael Fuhr <mike(at)fuhr(dot)org> |
Cc: | Greg Wittel <gwittel(at)proofpoint(dot)com>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Odd PL/PgSQL Error -- relation "X" does not exist when using index expression |
Date: | 2007-02-08 15:32:25 |
Message-ID: | 8064.1170948745@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Michael Fuhr <mike(at)fuhr(dot)org> writes:
> Using separate calls to SPI_exec() works. Using a single call to
> SPI_exec() works if the index is on (t) instead of (lower(t)):
> SPI_exec("CREATE TABLE foo (t text); CREATE INDEX foo_idx ON foo (t)", 0);
It's only by chance that it works in that case: the current coding of
transformIndexStmt happens not to try to touch the underlying table
if there aren't any expressions to analyze. You can make a large number
of variants that will fail, eg, create the table and try to insert into
it in one command string.
My advice is not to try to execute multiple commands in the same EXECUTE
string --- if we were going to do anything to "fix" this, I think it
would be along the lines of enforcing that advice. Trying to make the
world safe for it doesn't sound productive.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Fuhr | 2007-02-08 15:55:04 | Re: Odd PL/PgSQL Error -- relation "X" does not exist when using index expression |
Previous Message | Adrien Lebre | 2007-02-08 15:12:16 | unsubscribe |