Lists: | pgsql-hackers |
---|
From: | hubert depesz lubaczewski <depesz(at)depesz(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Enhanced psql in core? |
Date: | 2011-07-09 10:29:25 |
Message-ID: | 20110709102925.GA30835@depesz.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
hi,
would it be possible to incorporate
http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
This patch adds lots of nice functionalities, which we could definitely
use.
Best regards,
depesz
--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/
From: | Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com> |
---|---|
To: | depesz(at)depesz(dot)com |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-09 21:45:14 |
Message-ID: | CAF6yO=2jLG6XDOSyyQDi9GbVoiPvqrvqS9vR5vh3SjzBkUiuHg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
2011/7/9 hubert depesz lubaczewski <depesz(at)depesz(dot)com>:
> hi,
> would it be possible to incorporate
> http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
>
> This patch adds lots of nice functionalities, which we could definitely
> use.
Some features are very interesting but I I would suggest to split each
in a separate patch proposal.
The \lf is a must have, imo.
--
Cédric Villemain 2ndQuadrant
http://2ndQuadrant.fr/ PostgreSQL : Expertise, Formation et Support
From: | Jaime Casanova <jaime(at)2ndquadrant(dot)com> |
---|---|
To: | depesz(at)depesz(dot)com |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 01:14:26 |
Message-ID: | CAJKUy5goV51qP9mw9D0tPfbzaFe+p=4pOGRT_+oQjjwfGooxHg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sat, Jul 9, 2011 at 5:29 AM, hubert depesz lubaczewski
<depesz(at)depesz(dot)com> wrote:
> hi,
> would it be possible to incorporate
> http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
>
> This patch adds lots of nice functionalities, which we could definitely
> use.
>
big part of this seems to be (based on the examples on the page,
haven't read the patch) scripting functionality but now that we have
DO, is really a need for that?
i'm not really sure if we can do what the same as your example using
DO but i'm really dubious about the usefullness of that example.
--
Jaime Casanova www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
From: | Abel Abraham Camarillo Ojeda <acamari(at)verlet(dot)org> |
---|---|
To: | Jaime Casanova <jaime(at)2ndquadrant(dot)com> |
Cc: | depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 01:29:09 |
Message-ID: | CAPD=2NhK33W37ioRdzjSAijOgnDQ=wMqvQ89O2ykAKJXy6NsGA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sat, Jul 9, 2011 at 8:14 PM, Jaime Casanova <jaime(at)2ndquadrant(dot)com> wrote:
> On Sat, Jul 9, 2011 at 5:29 AM, hubert depesz lubaczewski
> <depesz(at)depesz(dot)com> wrote:
>> hi,
>> would it be possible to incorporate
>> http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
>>
>> This patch adds lots of nice functionalities, which we could definitely
>> use.
>>
>
> big part of this seems to be (based on the examples on the page,
> haven't read the patch) scripting functionality but now that we have
> DO, is really a need for that?
> i'm not really sure if we can do what the same as your example using
> DO but i'm really dubious about the usefullness of that example.
>
> --
> Jaime Casanova www.2ndQuadrant.com
> Professional PostgreSQL: Soporte 24x7 y capacitación
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
At least it would be useful to have conditional includes...
\if ...
\i something.sql
\endif
From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Jaime Casanova <jaime(at)2ndquadrant(dot)com> |
Cc: | depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 07:14:50 |
Message-ID: | CAFj8pRDdxseEc8-z8h3C-LPrv8yg1UW--Ai=wGR_Nb6jNvSDpg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
2011/7/10 Jaime Casanova <jaime(at)2ndquadrant(dot)com>:
> On Sat, Jul 9, 2011 at 5:29 AM, hubert depesz lubaczewski
> <depesz(at)depesz(dot)com> wrote:
>> hi,
>> would it be possible to incorporate
>> http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
>>
>> This patch adds lots of nice functionalities, which we could definitely
>> use.
>>
>
> big part of this seems to be (based on the examples on the page,
> haven't read the patch) scripting functionality but now that we have
> DO, is really a need for that?
> i'm not really sure if we can do what the same as your example using
> DO but i'm really dubious about the usefullness of that example.
>
DO has same limits like functions - you cannot to switch database, you
cannot to store data to psql's session variables, you cannot do
"include file"
Regards
Pavel
> --
> Jaime Casanova www.2ndQuadrant.com
> Professional PostgreSQL: Soporte 24x7 y capacitación
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com> |
Cc: | depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 07:23:50 |
Message-ID: | CAFj8pRBprO34vq2=x9W65eeBOwi5o1MFUX1RrqFvth9A7yes6g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hello
2011/7/9 Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>:
> 2011/7/9 hubert depesz lubaczewski <depesz(at)depesz(dot)com>:
>> hi,
>> would it be possible to incorporate
>> http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
>>
>> This patch adds lots of nice functionalities, which we could definitely
>> use.
>
> Some features are very interesting but I I would suggest to split each
> in a separate patch proposal.
>
> The \lf is a must have, imo.
This patch is relative old - a few features are in core now - UTF8
decoration, and listing function source code,
see \sf command in 9.1
I agree, so these features should be split. This old patch was a
"features preview"
there is areas:
* custom line's formats
* enhanced formatting - multiline headers, wrapping in white chars
* basic scripting - \execute function
* enhanced scripting \if \forc statements
* macros
Regards
Pavel Stehule
>
> --
> Cédric Villemain 2ndQuadrant
> http://2ndQuadrant.fr/ PostgreSQL : Expertise, Formation et Support
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Jaime Casanova <jaime(at)2ndquadrant(dot)com> |
Cc: | depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 07:25:22 |
Message-ID: | CAFj8pRBHFNBQVnt3O_YeKXdn5dJmLG7KHPPOS38QnQMeU3aHow@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
2011/7/10 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> 2011/7/10 Jaime Casanova <jaime(at)2ndquadrant(dot)com>:
>> On Sat, Jul 9, 2011 at 5:29 AM, hubert depesz lubaczewski
>> <depesz(at)depesz(dot)com> wrote:
>>> hi,
>>> would it be possible to incorporate
>>> http://www.postgres.cz/index.php/Enhanced-psql in core PostgreSQL/psql?
>>>
>>> This patch adds lots of nice functionalities, which we could definitely
>>> use.
>>>
>>
>> big part of this seems to be (based on the examples on the page,
>> haven't read the patch) scripting functionality but now that we have
>> DO, is really a need for that?
>> i'm not really sure if we can do what the same as your example using
>> DO but i'm really dubious about the usefullness of that example.
>>
>
> DO has same limits like functions - you cannot to switch database, you
> cannot to store data to psql's session variables, you cannot do
> "include file"
>
note - a output from DO statement is limited to RAISE statement - you
can't send back a SELECT's result
Regards
Pavel
> Regards
>
> Pavel
>
>
>
>> --
>> Jaime Casanova www.2ndQuadrant.com
>> Professional PostgreSQL: Soporte 24x7 y capacitación
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>>
>
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | Jaime Casanova <jaime(at)2ndquadrant(dot)com>, depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 16:51:15 |
Message-ID: | 2946.1310316675@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> 2011/7/10 Jaime Casanova <jaime(at)2ndquadrant(dot)com>:
>>> big part of this seems to be (based on the examples on the page,
>>> haven't read the patch) scripting functionality but now that we have
>>> DO, is really a need for that?
> note - a output from DO statement is limited to RAISE statement - you
> can't send back a SELECT's result
You can't *today*. But it's a very good question whether it wouldn't
make more sense to solve these problems by extending DO rather than
adding things into psql. Functionality in DO will be available to
non-psql clients.
regards, tom lane
From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Jaime Casanova <jaime(at)2ndquadrant(dot)com>, depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-10 18:24:41 |
Message-ID: | CAFj8pRCxB2m27s6G+VPjWDw=CRmuKOMPBvNWYyM+imfDMPc_2A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
2011/7/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>>> 2011/7/10 Jaime Casanova <jaime(at)2ndquadrant(dot)com>:
>>>> big part of this seems to be (based on the examples on the page,
>>>> haven't read the patch) scripting functionality but now that we have
>>>> DO, is really a need for that?
>
>> note - a output from DO statement is limited to RAISE statement - you
>> can't send back a SELECT's result
>
> You can't *today*. But it's a very good question whether it wouldn't
> make more sense to solve these problems by extending DO rather than
> adding things into psql. Functionality in DO will be available to
> non-psql clients.
>
It should be nice, and I like it - but I think, so some request for
psql enhancing will be valid still. As minimum I see a two features
(maybe three):
a) propagation of some value from server to psql session variables and
to system variables
b) conditional include, conditional processing
c) some form of "alias" like bash
These features should not be a complex. More complex scripting
features should be implemented in "noniteractive" fork of psql - this
is one form of possible solution - or not - I really don't need a new
language.
As minimum for more enhanced using of DO statement is possibility of a
access to psql's session variables, and possibility to return table
(tables) as result. I am not for introduction of new scripting
language like pgscript does, just thinking so some basic features to
psql should be nice - because psql has nice result formatting
features, and has good integration to host environment.
One idea - we can use a NOTIFICATION mechanism for getting a some psql
(or any client) session variable(s). This doesn't need a
parametrisation support for NOT SQL statement.
\set hellovar 'Hello'
DO $$
DECLARE vars text[];
BEGIN
vars := get_client_vars('hellovar');
vars[1] := vars[1] || ', world';
set_host_var('hellovar', vars[1]);
RAISE NOTICE '%', vars[1];
...
I agree with you, so there are no reason for introduction of new
language, but I don't think so DO is final solution and we can
continue without some psql enhancing.
Regards
Pavel
> regards, tom lane
>
From: | Stephen Frost <sfrost(at)snowman(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Enhanced psql in core? |
Date: | 2011-07-11 01:34:27 |
Message-ID: | 20110711013427.GO32313@tamriel.snowman.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> You can't *today*. But it's a very good question whether it wouldn't
> make more sense to solve these problems by extending DO rather than
> adding things into psql. Functionality in DO will be available to
> non-psql clients.
I don't think we're ever going to have DO able to do cross-database
things, or top-level transaction control, etc. Perhaps, some day, we'll
have a way to do that kind of thing in the back-end (I certainly hope
so, and Berkus had posted a lot of good thoughts about that not too long
ago), but even so, I think it'd be great to have some real scripting
capability in psql and I'm all for fixing the variable handling w/
a ":{var}" capability..
Thanks,
Stephen