Re: visibility rule in a EXECUTE with multi sql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: visibility rule in a EXECUTE with multi sql
Дата
Msg-id 1142.1207837390@sss.pgh.pa.us
обсуждение исходный текст
Ответ на visibility rule in a EXECUTE with multi sql  (laser <laserlist@pgsqldb.com>)
Список pgsql-general
laser <laserlist@pgsqldb.com> writes:
>  when I do a:

>  execute 'set search_path to bar; create table foo(f1 int);insert into
> table foo blah..blah;'

> in plpgsql, I found that the insert statement always report that "can't
> found table foo" or something
> like that.

Well, yeah.  The whole string is parsed, then executed, so you are
trying to parse the insert before foo exists.  Break it into multiple
EXECUTEs.  Or maybe you want "create table as select ...".

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "William Temperley"
Дата:
Сообщение: percentile rank query
Следующее
От: Stefan Schwarzer
Дата:
Сообщение: Proper Installation of Postgres and Postgis on 10.5 Intel