Re: pg_execute_from_file review

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Re: pg_execute_from_file review
Дата
Msg-id AANLkTinzSi2Cmj5kMPjVZdnfnf16V7zP=Qx-jhfB36Xm@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_execute_from_file review  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Dec 6, 2010 at 08:01, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Why is there a variadic replace() in this patch at all?  It seems just
> about entirely unrelated to the stated purpose of the patch, as well
> as being of dubious usefulness.

As I wrote in the previous mail, the most important part of the patch
for CREATE EXTENSION is pg_read_binary_file(). We can rewrite not only
replace(VARIADIC) but also other functions in the patch with existing
functions. However, the author wanted simple-case user APIs, and I also
agreed to export each step of the complex pg_execute_sql_file().

But I have no objections to hide some of the subroutines if there are
any problems.

| $sql := replace(
|          convert_from(
|            pg_read_binary_file($path, 0),
|            $encoding),
|          '@extschema@', $schema));
| EXECUTE $sql;

-- 
Itagaki Takahiro


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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Spread checkpoint sync
Следующее
От: Robert Haas
Дата:
Сообщение: Re: FK's to refer to rows in inheritance child