Re: pg_execute_from_file review

From: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Joshua Tolley <eggyknap(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_execute_from_file review
Date: 2010-12-06 01:30:03
Message-ID: AANLkTinzSi2Cmj5kMPjVZdnfnf16V7zP=Qx-jhfB36Xm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 6, 2010 at 08:01, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-06 01:42:12 Re: FK's to refer to rows in inheritance child
Previous Message Greg Smith 2010-12-05 23:02:48 Re: Spread checkpoint sync