Michael Fuhr <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq