[PATCH] Psql List Languages

Lists: pgsql-hackers
From: Fernando Ike <fike(at)midstorm(dot)org>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Psql List Languages
Date: 2009-01-30 17:03:57
Message-ID: 1ed3e91a0901300903ldfcafcche9859ae180be261c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,,

My job, I maintainer some postgres server for clients. We have
many PL/(Java, Perl, Ruby, Python, R) and to more easy
administration, I worked new little psql attribute to list languages
com shorcurt/function \dL.

postgres(at)darkside:/media/disk/devel/pg$ bin/psql -U postgres test
psql (8.4devel)
Type "help" for help.

test=# \dL
List of languages
Name | Owner | Procedural Language | Trusted | Call
Handler | Validator
----------+----------+---------------------+------------+---------------------+-------------------------
c | postgres | No | Unstrusted |
| fmgr_c_validator
internal | postgres | No | Unstrusted |
| fmgr_internal_validator
plperl | postgres | Yes | Trusted |
plperl_call_handler | plperl_validator
sql | postgres | No | Trusted |
| fmgr_sql_validator
(4 rows)

test=#

I know that this moment is inappropriate to submit patch, with the
discussions about features for 8.4. But, if can added for commitfest
to 8.5 version. I'm appreciate.

Regards,
--
Fernando Ike
http://www.midstorm.org/~fike/weblog

Attachment Content-Type Size
psql_list_language_v1.patch text/x-diff 3.4 KB

From: Fernando Ike <fike(at)midstorm(dot)org>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-02-02 13:29:51
Message-ID: 1ed3e91a0902020529j12c2b12cy63fede6df48c5f91@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On Fri, Jan 30, 2009 at 3:03 PM, Fernando Ike <fike(at)midstorm(dot)org> wrote:
> Hi,,
>
> My job, I maintainer some postgres server for clients. We have
> many PL/(Java, Perl, Ruby, Python, R) and to more easy
> administration, I worked new little psql attribute to list languages
> com shorcurt/function \dL.
[..]
> I know that this moment is inappropriate to submit patch, with the
> discussions about features for 8.4. But, if can added for commitfest
> to 8.5 version. I'm appreciate.

I update patch for added gettext fields and change spaces/tab to 4 spaces. :)

Cheers,
--
Fernando Ike

Attachment Content-Type Size
psql_list_language_v2.patch text/x-diff 3.5 KB

From: David Fetter <david(at)fetter(dot)org>
To: Fernando Ike <fike(at)midstorm(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-02-02 13:39:44
Message-ID: 20090202133944.GA17601@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Feb 02, 2009 at 11:29:51AM -0200, Fernando Ike wrote:
> Hi,
>
>
> On Fri, Jan 30, 2009 at 3:03 PM, Fernando Ike <fike(at)midstorm(dot)org> wrote:
> > Hi,,
> >
> > My job, I maintainer some postgres server for clients. We have
> > many PL/(Java, Perl, Ruby, Python, R) and to more easy
> > administration, I worked new little psql attribute to list languages
> > com shorcurt/function \dL.
> [..]
> > I know that this moment is inappropriate to submit patch, with the
> > discussions about features for 8.4. But, if can added for commitfest
> > to 8.5 version. I'm appreciate.
>
> I update patch for added gettext fields and change spaces/tab to 4 spaces. :)

+1 for adding this :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Fernando Ike <fike(at)midstorm(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-02-11 10:37:20
Message-ID: 4992AA60.8010505@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fernando Ike wrote:
> I know that this moment is inappropriate to submit patch, with the
> discussions about features for 8.4. But, if can added for commitfest
> to 8.5 version. I'm appreciate.

Yes, please add it to the first 8.5 commit fest. You can edit the wiki
yourself.


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Fernando Ike <fike(at)midstorm(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-02 19:12:06
Message-ID: 200907022212.06975.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Monday 02 February 2009 15:29:51 Fernando Ike wrote:
> Hi,
>
> On Fri, Jan 30, 2009 at 3:03 PM, Fernando Ike <fike(at)midstorm(dot)org> wrote:
> > Hi,,
> >
> > My job, I maintainer some postgres server for clients. We have
> > many PL/(Java, Perl, Ruby, Python, R) and to more easy
> > administration, I worked new little psql attribute to list languages
> > com shorcurt/function \dL.
>
> [..]
>
> > I know that this moment is inappropriate to submit patch, with the
> > discussions about features for 8.4. But, if can added for commitfest
> > to 8.5 version. I'm appreciate.
>
> I update patch for added gettext fields and change spaces/tab to 4
> spaces. :)

Looks good, but needs documentation and tab-complete.c updates, it seems. And
you should revisit this patch to make it consistent with the S flag that was
added to most \d commands. For example, \dL would show only user-added
languages, but \dLS would include c, internal, and sql.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Fernando Ike <fike(at)midstorm(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-02 19:27:33
Message-ID: 5176.1246562853@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Looks good, but needs documentation and tab-complete.c updates, it seems. And
> you should revisit this patch to make it consistent with the S flag that was
> added to most \d commands. For example, \dL would show only user-added
> languages, but \dLS would include c, internal, and sql.

Another recent change in the \d support is that commands are expected to
work (as best they can) for all server versions back to 7.4. I didn't
look to see if this patch needs any fixes for that, but it's something
to keep in mind while reviewing.

regards, tom lane


From: Fernando Ike de Oliveira <fike(at)midstorm(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-15 21:38:31
Message-ID: 20090715183831.21cc603a@darkside
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Em Thu, 02 Jul 2009 15:27:33 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Looks good, but needs documentation and tab-complete.c updates, it
> > seems. And you should revisit this patch to make it consistent
> > with the S flag that was added to most \d commands. For example,
> > \dL would show only user-added languages, but \dLS would include c,
> > internal, and sql.
>
> Another recent change in the \d support is that commands are expected
> to work (as best they can) for all server versions back to 7.4. I
> didn't look to see if this patch needs any fixes for that, but it's
> something to keep in mind while reviewing.

I applied the Tom Lane and Peter considerations, but I had that
remove one column (Owner) of out command \dL to compatibility with 7.4
version. The command \dLS output:

test=# \dLS
List of languages
Name | Procedural Language | Trusted | Call Handler |
Validator
----------+---------------------+-----------+----------------------+
-------------------------
c | Untrusted | Untrusted | |
fmgr_c_validator
internal | Untrusted | Untrusted | |
fmgr_internal_validator
plperl | Trusted | Trusted | plperl_call_handler |
plperl_validator
plpgsql | Trusted | Trusted | plpgsql_call_handler |
plpgsql_validator
pltcl | Trusted | Trusted | pltcl_call_handler |

sql | Untrusted | Trusted | |
fmgr_sql_validator
(6 rows)

test=#

Comments?

Best Regards,
--
Fernando Ike

Attachment Content-Type Size
psql_list_lang_v3.patch text/x-patch 5.6 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Fernando Ike de Oliveira <fike(at)midstorm(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-16 13:41:37
Message-ID: 200907161641.38028.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thursday 16 July 2009 00:38:31 Fernando Ike de Oliveira wrote:
> I applied the Tom Lane and Peter considerations, but I had that
> remove one column (Owner) of out command \dL to compatibility with 7.4
> version.

The mandate is to work as best as they can with older versions, not to provide
only the feature set that works the same across old versions. The correct
behavior should be to show the owner column if the server version supports it.


From: Fernando Ike <fike(at)midstorm(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-17 15:26:31
Message-ID: 1ed3e91a0907170826s3e47bf57q7f9f2fce23be3e82@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 16, 2009 at 10:41 AM, Peter Eisentraut<peter_e(at)gmx(dot)net> wrote:
> On Thursday 16 July 2009 00:38:31 Fernando Ike de Oliveira wrote:
>>   I applied the Tom Lane and Peter considerations, but I had that
>> remove one column (Owner) of out command \dL to compatibility with 7.4
>> version.
>
> The mandate is to work as best as they can with older versions, not to provide
> only the feature set that works the same across old versions.  The correct
> behavior should be to show the owner column if the server version supports it.

Thanks for comment, Peter

Follow new version patch, now with version postgresql version.

Regards,
--
Fernando Ike

Attachment Content-Type Size
psql_list_lang_v4.patch text/x-diff 5.6 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Fernando Ike <fike(at)midstorm(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-19 08:00:49
Message-ID: 200907191100.50278.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Friday 17 July 2009 18:26:31 Fernando Ike wrote:
> Follow new version patch, now with version postgresql version.

1) This is obviously wrong:

CASE WHEN l.lanispl = 't' THEN 'Trusted' WHEN l.lanispl = 'f' THEN 'Untrusted'
END

2) It may be better to use lanispl to determine whether a language is a system
object or not. It's kind of obscure, but pg_dump does it that way, so it'd at
least be consistent.

3) Your code does processSQLNamePattern(), but neither the help nor the
documentation mention that \dL accepts a pattern. A pattern for listing
languages might be overkill, but at least the documentation needs to match
what the code attempts to do.

4) Instead of LEFT JOIN pg_catalog.pg_proc p on l.lanplcallfoid = p.oid etc,
just cast the oid field to regprocedure. See examples elsewhere in
describe.c.

Please submit an updated patch.


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Fernando Ike <fike(at)midstorm(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-23 01:23:39
Message-ID: 603c8f070907221823t5b341c46qc9dc6460ff755921@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jul 19, 2009 at 4:00 AM, Peter Eisentraut<peter_e(at)gmx(dot)net> wrote:
> Please submit an updated patch.

Fernando,

If you would like to have this change committed during this
CommitFest, please submit an updated patch ASAP. Otherwise, you can
resubmit for the next CommitFest in September.

Thanks,

...Robert


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-23 01:35:03
Message-ID: 407d949e0907221835s5f2c416em51d8cbcb257290d1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 23, 2009 at 2:23 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
> If you would like to have this change committed during this
> CommitFest, please submit an updated patch ASAP.  Otherwise, you can
> resubmit for the next CommitFest in September.

You know, I don't think we have any rules against people responding to
patches submitted outside commitfest periods...

--
greg
http://mit.edu/~gsstark/resume.pdf


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-23 01:43:18
Message-ID: 603c8f070907221843i40ace27ej2835623bbe907d34@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 22, 2009 at 9:35 PM, Greg Stark<gsstark(at)mit(dot)edu> wrote:
> On Thu, Jul 23, 2009 at 2:23 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
>> If you would like to have this change committed during this
>> CommitFest, please submit an updated patch ASAP.  Otherwise, you can
>> resubmit for the next CommitFest in September.
>
> You know, I don't think we have any rules against people responding to
> patches submitted outside commitfest periods...

I never suggested otherwise. In fact, I think it works much better
when people DO respond to patches submitted outside CommitFests.
What's your point?

...Robert


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-23 02:11:00
Message-ID: 603c8f070907221911y1bd8b806jc871437593bd6cdb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 22, 2009 at 9:43 PM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Jul 22, 2009 at 9:35 PM, Greg Stark<gsstark(at)mit(dot)edu> wrote:
>> On Thu, Jul 23, 2009 at 2:23 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
>>> If you would like to have this change committed during this
>>> CommitFest, please submit an updated patch ASAP.  Otherwise, you can
>>> resubmit for the next CommitFest in September.
>>
>> You know, I don't think we have any rules against people responding to
>> patches submitted outside commitfest periods...
>
> I never suggested otherwise.  In fact, I think it works much better
> when people DO respond to patches submitted outside CommitFests.
> What's your point?

To follow up on that thought a little more...

The patch author is certainly free to resubmit the patch at any time,
and Peter (or any other committer) can commit it at any time, and may
well do so. However, as far as the CommitFest process is concerned,
we need to wrap things up within a finite time period that is not very
long, and that can only happen if both reviews and resubmits happen in
a timely fashion, so, since I've been tapped to manage this
CommitFest, I'm trying to do what I can to keep on top of that.

If my email struck you as rude, I certainly apologize for that. I'm
trying really hard to be efficient about this without stepping on
anyone's feelings, but that's a fine line to walk and I'm not sure
I'll always be on the right side of it.

Also, as a practical matter, while patches CAN get committed at any
given time, one of the purposes of CommitFests, at least AIUI, is to
give reviewers and committers a break from dealing with other people's
patches. In other words, when it is NOT time for a CommitFest, as Tom
put it, people shouldn't feel guilty about working on their own
patches rather than reviewing. When it IS time for a CommitFest, they
should. So the time when patches are *most likely* to be committed is
during a CommitFest, and that is why I think there would be a benefit
to the author of this patch in resubmitting it soon.

I am trying to introduce something of a procedural change from the
last CommitFest in that I think that the deadline for any particular
patch to be resubmitted should be based at least in part on when it
was reviewed, and not just on how many days we "have left" in the
CommitFest, to avoid a huge pile of resubmissions just before some
arbitrary cutoff, which then creates an unsupportable burden for
reviewers and committers, or else just makes the CommitFest drag on
and on. I think that's pretty reasonable. In fact, it's far MORE
reasonable than what we did last time, where patches that got reviewed
early sat around and were resubmitted at a very liesurely pace over a
period of months, while other patches that got reviewed late got
looked at once (or maybe twice) and then punted.

Hopefully that seems reasonable - if not, let's discuss (perhaps after
changing to a new thread).

...Robert


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-23 02:40:51
Message-ID: 407d949e0907221940h2ee72329q3cd3520b1d166e55@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 23, 2009 at 3:11 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
>
> If my email struck you as rude, I certainly apologize for that.  I'm
> trying really hard to be efficient about this without stepping on
> anyone's feelings, but that's a fine line to walk and I'm not sure
> I'll always be on the right side of it.

I didn't think your email was rude at all. Just that it could be
(mis)construed to mean that if a patch isn't committed now the only
time they'll get feedback again is next commitfest.

--
greg
http://mit.edu/~gsstark/resume.pdf


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Fernando Ike <fike(at)midstorm(dot)org>
Subject: Re: [PATCH] Psql List Languages
Date: 2009-07-28 12:09:40
Message-ID: 603c8f070907280509i4ddd42bcxe8defb9f3019ff4e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 22, 2009 at 9:23 PM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
> On Sun, Jul 19, 2009 at 4:00 AM, Peter Eisentraut<peter_e(at)gmx(dot)net> wrote:
>> Please submit an updated patch.
>
> If you would like to have this change committed during this
> CommitFest, please submit an updated patch ASAP.  Otherwise, you can
> resubmit for the next CommitFest in September.

As this patch has not been updated, I am moving it to "Returned with Feedback".

...Robert