From: | "Karl O(dot) Pinc" <kop(at)meme(dot)com> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: gset updated patch |
Date: | 2012-11-16 15:42:01 |
Message-ID: | 1353080521.29131.0@mofo |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Pavel,
On 11/16/2012 12:21:11 AM, Pavel Stehule wrote:
> 2012/11/16 Karl O. Pinc <kop(at)meme(dot)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".
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(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-11-16 15:46:54 | Re: another idea for changing global configuration settings from SQL |
Previous Message | Merlin Moncure | 2012-11-16 15:40:51 | Re: Materialized views WIP patch |