Re: pg_execute_from_file review - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: pg_execute_from_file review
Date
Msg-id AANLkTinzSi2Cmj5kMPjVZdnfnf16V7zP=Qx-jhfB36Xm@mail.gmail.com
Whole thread Raw
In response to Re: pg_execute_from_file review  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Greg Smith
Date:
Subject: Re: Spread checkpoint sync
Next
From: Robert Haas
Date:
Subject: Re: FK's to refer to rows in inheritance child