psql with "Function Type" in \df
Folks,
Here's a patch that adds a "Function Type" column to \df while
removing the now-redundant \da.
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Attachments:
describe_type.difftext/plain; charset=us-asciiDownload+42-109
David Fetter <david@fetter.org> writes:
Here's a patch that adds a "Function Type" column to \df while
removing the now-redundant \da.
Removing \da altogether was nowhere in the consensus, or even in the
discussion AFAIR. Also, what is the point of using single-letter
type codes when you've made the column header about as verbose as
it could get? I'd go for something like
Type
window
agg
trigger
normal
Or we could spell out "aggregate", but that makes the column a
couple of characters wider ...
regards, tom lane
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Here's a patch that adds a "Function Type" column to \df while
removing the now-redundant \da.
1. How does it make it redundant - is there a way to view all
aggregates with \df now?
2. Even if the above is satisfied, I think we need a little more
discussion before completely removing a now-functioning backslash
command.
Other than that, +1 ;)
- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200904131945
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----
iEYEAREDAAYFAknjzrgACgkQvJuQZxSWSsjoWQCfSNxVbmL85Z6FDMQOu8rmsHxh
wuwAn1t0pmQ8cqI/e3m+3eADi7cMTGOm
=wKRy
-----END PGP SIGNATURE-----
On Mon, Apr 13, 2009 at 07:24:31PM -0400, Tom Lane wrote:
David Fetter <david@fetter.org> writes:
Here's a patch that adds a "Function Type" column to \df while
removing the now-redundant \da.Removing \da altogether was nowhere in the consensus, or even in the
discussion AFAIR.
It's back.
Also, what is the point of using single-letter type codes when
you've made the column header about as verbose as it could get? I'd
go for something likeType
window
agg
trigger
normalOr we could spell out "aggregate", but that makes the column a
couple of characters wider ...
Done.
I've also added \df[antw], which lets people narrow their search.
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Attachments:
describe_type_extraletters.difftext/plain; charset=us-asciiDownload+274-51
David Fetter <david@fetter.org> writes:
On Mon, Apr 13, 2009 at 07:24:31PM -0400, Tom Lane wrote:
I'd go for something like
Type
window
agg
trigger
normalOr we could spell out "aggregate", but that makes the column a
couple of characters wider ...
Done.
I had a second thought about that: presumably we should make the
function type names translatable. If we do that, it might be better
to make the aggregate case be "aggregate" and take the width hit.
Otherwise translators are going to be puzzled when they come across
"agg" as a translatable phrase.
Or maybe I'm overthinking that problem. Comments from anyone who
actually does translations?
I've also added \df[antw], which lets people narrow their search.
Why didn't you make it work like \d[tisv], ie allow more than one
letter? If you're going to be inventing new features at this late
date, they should at least work like the adjacent precedent.
regards, tom lane
On Tue, Apr 14, 2009 at 12:35:21PM -0400, Tom Lane wrote:
David Fetter <david@fetter.org> writes:
On Mon, Apr 13, 2009 at 07:24:31PM -0400, Tom Lane wrote:
I'd go for something like
Type
window
agg
trigger
normalOr we could spell out "aggregate", but that makes the column a
couple of characters wider ...Done.
I had a second thought about that: presumably we should make the
function type names translatable. If we do that, it might be better
to make the aggregate case be "aggregate" and take the width hit.
Otherwise translators are going to be puzzled when they come across
"agg" as a translatable phrase.
OK
Or maybe I'm overthinking that problem. Comments from anyone who
actually does translations?I've also added \df[antw], which lets people narrow their search.
Why didn't you make it work like \d[tisv], ie allow more than one
letter? If you're going to be inventing new features at this late
date, they should at least work like the adjacent precedent.
Because I didn't think of it. Lemme see about that :)
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Tom Lane wrote:
I had a second thought about that: presumably we should make the
function type names translatable. If we do that, it might be better
to make the aggregate case be "aggregate" and take the width hit.
Otherwise translators are going to be puzzled when they come across
"agg" as a translatable phrase.
I think it's good to have them translatable. As for using "aggregate"
instead of "agg" I don't think it's that great an idea. If you need to
notify translators that "agg" stands for "aggregate", add a
/* translator: */ comment.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
On Tue, Apr 14, 2009 at 02:52:32PM -0400, Alvaro Herrera wrote:
Tom Lane wrote:
I had a second thought about that: presumably we should make the
function type names translatable. If we do that, it might be
better to make the aggregate case be "aggregate" and take the
width hit. Otherwise translators are going to be puzzled when
they come across "agg" as a translatable phrase.I think it's good to have them translatable. As for using
"aggregate" instead of "agg" I don't think it's that great an idea.
If you need to notify translators that "agg" stands for "aggregate",
add a /* translator: */ comment.
Where would I add that? First mention, each time, or...?
Cheers,
David (reworking patch per suggestions)
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
David Fetter wrote:
On Tue, Apr 14, 2009 at 02:52:32PM -0400, Alvaro Herrera wrote:
I think it's good to have them translatable. As for using
"aggregate" instead of "agg" I don't think it's that great an idea.
If you need to notify translators that "agg" stands for "aggregate",
add a /* translator: */ comment.Where would I add that? First mention, each time, or...?
Is there more than one mention of "agg"?
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
On Tue, Apr 14, 2009 at 03:04:55PM -0400, Alvaro Herrera wrote:
David Fetter wrote:
On Tue, Apr 14, 2009 at 02:52:32PM -0400, Alvaro Herrera wrote:
I think it's good to have them translatable. As for using
"aggregate" instead of "agg" I don't think it's that great an
idea. If you need to notify translators that "agg" stands for
"aggregate", add a /* translator: */ comment.Where would I add that? First mention, each time, or...?
Is there more than one mention of "agg"?
It's in 3 branches in describe.c.
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
On Tue, Apr 14, 2009 at 02:52:32PM -0400, Alvaro Herrera wrote:
Tom Lane wrote:
I had a second thought about that: presumably we should make the
function type names translatable. If we do that, it might be better
to make the aggregate case be "aggregate" and take the width hit.
Otherwise translators are going to be puzzled when they come across
"agg" as a translatable phrase.I think it's good to have them translatable. As for using "aggregate"
instead of "agg" I don't think it's that great an idea. If you need to
notify translators that "agg" stands for "aggregate", add a
/* translator: */ comment.
Here's the next revision :)
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Attachments:
describe_type_extraletters2.difftext/plain; charset=us-asciiDownload+172-36
On Tue, Apr 14, 2009 at 03:18:06PM -0700, David Fetter wrote:
On Tue, Apr 14, 2009 at 02:52:32PM -0400, Alvaro Herrera wrote:
Tom Lane wrote:
I had a second thought about that: presumably we should make the
function type names translatable. If we do that, it might be better
to make the aggregate case be "aggregate" and take the width hit.
Otherwise translators are going to be puzzled when they come across
"agg" as a translatable phrase.I think it's good to have them translatable. As for using "aggregate"
instead of "agg" I don't think it's that great an idea. If you need to
notify translators that "agg" stands for "aggregate", add a
/* translator: */ comment.Here's the next revision :)
This time, with less-Byzantine logic, and no egregious whitespace
changes. :)
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Attachments:
describe_type_extraletters3.difftext/plain; charset=us-asciiDownload+158-27
David Fetter wrote:
I think it's good to have them translatable. As for using "aggregate"
instead of "agg" I don't think it's that great an idea. If you need to
notify translators that "agg" stands for "aggregate", add a
/* translator: */ comment.
The "translator: " comment needs to be in the line just above the
string. Right now the PO file looks like this:
#: describe.c:243 describe.c:288 describe.c:304
msgid "agg"
msgstr ""
#. translator: "agg" is short for "aggregate"
#: describe.c:244
msgid "window"
msgstr ""
Note really what we want ...
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
On Wed, Apr 15, 2009 at 08:54:10PM -0400, Alvaro Herrera wrote:
David Fetter wrote:
I think it's good to have them translatable. As for using "aggregate"
instead of "agg" I don't think it's that great an idea. If you need to
notify translators that "agg" stands for "aggregate", add a
/* translator: */ comment.The "translator: " comment needs to be in the line just above the
string. Right now the PO file looks like this:#: describe.c:243 describe.c:288 describe.c:304
msgid "agg"
msgstr ""#. translator: "agg" is short for "aggregate"
#: describe.c:244
msgid "window"
msgstr ""Note really what we want ...
Is this any better?
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Attachments:
describe_type_extraletters4.difftext/plain; charset=us-asciiDownload+161-27
David Fetter wrote:
On Wed, Apr 15, 2009 at 08:54:10PM -0400, Alvaro Herrera wrote:
The "translator: " comment needs to be in the line just above the
string.Is this any better?
Yeah, this one is good (as far as this very minor detail is concerned anyway)
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
David Fetter wrote:
Is this any better?
So what happens if I do \dfaQ? It should throw an error, yes?
This help line:
+ fprintf(output, _(" \\df[S+] [PATTERN] list functions. Add a, n, t, w for aggregate, normal, trigger, window\n"));
needs shortening to below 80 chars (or maybe split it in two lines.
Just make sure they are a single translation item).
It also seems like we're missing tab completion support for this.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
On Fri, Apr 17, 2009 at 04:42:31PM -0400, Alvaro Herrera wrote:
David Fetter wrote:
Is this any better?
So what happens if I do \dfaQ? It should throw an error, yes?
This help line:
+ fprintf(output, _(" \\df[S+] [PATTERN] list functions. Add a, n, t, w for aggregate, normal, trigger, window\n"));
needs shortening to below 80 chars (or maybe split it in two lines.
Just make sure they are a single translation item).
OK.
It also seems like we're missing tab completion support for this.
Oops. Working on that now.
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
On Fri, Apr 17, 2009 at 04:42:31PM -0400, Alvaro Herrera wrote:
David Fetter wrote:
Is this any better?
So what happens if I do \dfaQ? It should throw an error, yes?
Interesting question.
This help line:
+ fprintf(output, _(" \\df[S+] [PATTERN] list functions. Add a, n, t, w for aggregate, normal, trigger, window\n"));
needs shortening to below 80 chars (or maybe split it in two lines.
Just make sure they are a single translation item).It also seems like we're missing tab completion support for this.
This is another interesting question. I notice that the tab
completion doesn't support things like \dit.
Should I add that as a separate patch?
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
David Fetter wrote:
On Wed, Apr 15, 2009 at 08:54:10PM -0400, Alvaro Herrera wrote:
David Fetter wrote:
I think it's good to have them translatable. As for using "aggregate"
instead of "agg" I don't think it's that great an idea. If you need to
notify translators that "agg" stands for "aggregate", add a
/* translator: */ comment.The "translator: " comment needs to be in the line just above the
string. Right now the PO file looks like this:#: describe.c:243 describe.c:288 describe.c:304
msgid "agg"
msgstr ""#. translator: "agg" is short for "aggregate"
#: describe.c:244
msgid "window"
msgstr ""Note really what we want ...
Is this any better?
Modified patch applied. I modified the \? display to be two lines:
\df[S+] [PATTERN] list functions
\df[antwS+] [PATTERN] list only agg/normal/trigger/window functions
and adjusted the code and documentation a bit. I removed the
release.sgml patch because that part will be done when the release notes
are updated and I was worried it might confuse things to add it now.
Thanks, the output looks very good.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Attachments:
/rtmp/difftext/x-diffDownload+186-165
Bruce Momjian <bruce@momjian.us> wrote:
\df[S+] [PATTERN] list functions
\df[antwS+] [PATTERN] list only agg/normal/trigger/window functions
Shouldn't that second line have some curly braces? Like maybe:
\df{antw}[S+] [PATTERN] list only agg/normal/trigger/window functions
Technically, it should probably be even more verbose, but this might
be adequate.
-Kevin