Vlad Arkhipov <arhi...@dc.baikal.ru> writes:
> 3. ERROR:  relation "t" does not exist
> SELECT _EXEC('CREATE TABLE T(ID INTEGER); INSERT INTO T(ID) VALUES (1)');

> 4. Inserts NULL value into ID column instead of default 10.
> BEGIN WORK;
> CREATE TABLE T(ID INTEGER);
> SELECT _EXEC('ALTER TABLE T ALTER COLUMN ID SET DEFAULT(10); INSERT INTO 
> T DEFAULT VALUES');

Commands submitted in a single string are typically parsed and planned
before they are executed (though the behavior probably depends on
context and which PG version you're talking about).  My advice is
don't do that.

If we were to do anything about it, it'd probably be to ban
multi-statement EXECUTE on security grounds ...

                        regards, tom lane
-
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to