Re: Add \i option to bring in the specified file as a quoted literal

From: Piotr Marcinczyk <pmarcinc(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: Add \i option to bring in the specified file as a quoted literal
Date: 2013-11-14 21:11:56
Message-ID: 1384463516.15301.22.camel@centos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dnia 2013-11-13, śro o godzinie 10:26 -0500, Bruce Momjian pisze:
> On Wed, Nov 13, 2013 at 08:58:07AM +0530, Amit Kapila wrote:
> > On Tue, Nov 12, 2013 at 9:37 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > On Wed, Oct 23, 2013 at 10:31:39AM +0530, Amit Kapila wrote:
> > >> On Tue, Oct 22, 2013 at 3:04 AM, Piotr Marcinczyk <pmarcinc(at)gmail(dot)com> wrote:
> > >> > Hi,
> > >> >
> > >> > I would like to implement item from TODO marked as easy: "Add \i option
> > >> > to bring in the specified file as a quoted literal". I understand intent
> > >> > of this item, to be able to have parts of query written in separate
> > >> > files (now it is impossible, because \i tries to execute content of file
> > >> > as a separate command by function process_file).
> > >>
> > >> For the usecase discussed in the mail chain of that TODO item, Robert
> > >> Haas has provided an alternative to achieve it, please check below
> > >> link:
> > >> http://www.postgresql.org/message-id/AANLkTi=7C8xFYF7uQW0y+si8oNdKoY2NX8jc4bU0GWvY@mail.gmail.com
> > >>
> > >> If you think that alternative is not sufficient for the use case, then
> > >> adding new option/syntax is worth, otherwise it might be a shortcut or
> > >> other form of some existing way which can be useful depending on how
> > >> frequently users use this syntax.
> > >
> > > So, can we remove this TODO item?
> > TODO item is created before Robert Haas has provided an alternative
> > way to achieve the same thing. In some cases there are multiple ways
> > to
> > achieve the same thing (example: shortcut options in psql) if it is
> > used quite frequently and people want some easy way of doing it. In
> > this case I
> > don't think this is used frequently, so I don't see the need of
> > doing it. We should remove this TODO item.
>
> OK, removed.
>
Well, I wrote it few days ago. I'm sure it is not critical, but I
suppose it may be useful. This is my first patch, so I think that it is
good idea to sent it and have it reviewed anyway. First argument to send
it, is to see what kind of errors I made, to not do them in the next
patches. Second, if it (flexible appending file to buffer) appears
interesting for reviewer, it may be committed.

Attachment Content-Type Size
include_quotted_v1.patch text/x-patch 5.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-11-14 21:23:52 Re: Transaction-lifespan memory leak with plpgsql DO blocks
Previous Message Dimitri Fontaine 2013-11-14 20:50:31 Re: LISTEN / NOTIFY enhancement request for Postgresql