Re: gset updated patch - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: gset updated patch
Date
Msg-id CAFj8pRAGY7L=bhUF7t38C4QppzcbFUdaMXdOU+xxv1OEz3oFAA@mail.gmail.com
Whole thread Raw
In response to Re: gset updated patch  ("Karl O. Pinc" <kop@meme.com>)
Responses Re: gset updated patch
List pgsql-hackers
Hello

2012/11/16 Karl O. Pinc <kop@meme.com>:
> Hi Pavel,
>
> On 11/16/2012 12:21:11 AM, Pavel Stehule wrote:
>> 2012/11/16 Karl O. Pinc <kop@meme.com>:
>
>> > As long as I'm talking crazy talk, why not
>> > abandon psql as a shell language and instead make a
>> > pl/pgsql interpreter with readlne() in front
>> > of it?   Solve all these language-related
>> > issues by using an actual programming language.  :-)
>
>> I though about it more time, but I don't thinking so this has a
>> sense.
>> Actually we cannot do perfect autocomplete for significantly simpler
>> SQL and there are lot of client side interprets - is not reason for
>> next one. I use psql together bash and it works well. But just very
>> simple task as storing some volatile data for repetitive usage is
>> relative laborious and it is a motivation for this patch. In psql I
>> can simply work with any fields of returned record - what is more
>> terrible work outside psql
>
> You might consider using "do".

it is reason, why I don't thinking about plpgsql on client side. But I
don't understand how it is related to gset ?

I remember, there is one significant limit of DO statement - it cannot
return table - so it cannot substitute psql simple scripts. But I
don't would open this topic now - it is related to real stored
procedures implementation, and it is long time task. So gset allow
some simple tasks solve simply

Regards

Pavel Stehule

>
> http://www.postgresql.org/docs/9.1/static/sql-do.html
>
> If you need to maintain a single connection you can do
> some interesting things with socat to feed a running psql
> in the background.
>
>  socat -u UNIX-RECV:/tmp/msock EXEC:psql &
>
> Followed by lots of
>
>  echo bar | socat -u STDIN UNIX-SENDTO:/tmp/mysock
>
> \o can be used to send output for pickup, although
> you do need to fuss around with the asynchronous nature
> of things to be sure you're waiting for output.
> I used inotifywait for this.  YMMV.
>
> Regards,
>
> Karl <kop@meme.com>
> Free Software:  "You don't pay back, you pay forward."
>                  -- Robert A. Heinlein
>



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 9.3 pg_archivecleanup broken?
Next
From: Dimitri Fontaine
Date:
Subject: Re: pg_dump --split patch