Updated backslash consistency patch
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.
--
Greg Sabino Mullane
Attachments:
newbackslash_consistency.patchtext/x-patch; name=newbackslash_consistency.patchDownload+141-110
Greg Sabino Mullane wrote:
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.
Some comments:
1. toast objects no longer show up anywhere; they are removed in the
non-system case by excluding pg_toast% schemas, and are removed in the
system case by requiring nspname = 'pg_catalog'
2. the help.c patch no longer applies due to the \dC patch recently
applied
3. the help.c patch breaks alignment of the help output. I think the
best way to fix it would be to change [PATTERN] into something shorter
like [PAT] and add a mention to that in the first line, something like
fprintf(output, _("Informational\n"));
! fprintf(output, _(" Modifiers: S = show system objects + = Additional detail\n"));
fprintf(output, _(" [PAT] means an optional glob-like pattern\n");
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Alvaro Herrera <alvherre@commandprompt.com> writes:
3. the help.c patch breaks alignment of the help output. I think the
best way to fix it would be to change [PATTERN] into something shorter
like [PAT] and add a mention to that in the first line, something like
I'd rather stick with [PATTERN]. Can't we just add more spaces to keep
all the descriptions aligned?
regards, tom lane
Tom Lane wrote:
Alvaro Herrera <alvherre@commandprompt.com> writes:
3. the help.c patch breaks alignment of the help output. I think the
best way to fix it would be to change [PATTERN] into something shorter
like [PAT] and add a mention to that in the first line, something likeI'd rather stick with [PATTERN]. Can't we just add more spaces to keep
all the descriptions aligned?
Yes, but it shortens the available space for all the texts (which could
cause some of them to become two lines, but I didn't check) and it means
the translations have to be updated.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Alvaro Herrera wrote:
Tom Lane wrote:
Alvaro Herrera <alvherre@commandprompt.com> writes:
3. the help.c patch breaks alignment of the help output. I think the
best way to fix it would be to change [PATTERN] into something shorter
like [PAT] and add a mention to that in the first line, something likeI'd rather stick with [PATTERN]. Can't we just add more spaces to keep
all the descriptions aligned?Yes, but it shortens the available space for all the texts (which could
cause some of them to become two lines, but I didn't check) and it means
the translations have to be updated.
Forgot to add: ... but I don't really care all that much, as long as
alignment is OK as a whole.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Alvaro Herrera <alvherre@commandprompt.com> writes:
Tom Lane wrote:
I'd rather stick with [PATTERN]. Can't we just add more spaces to keep
all the descriptions aligned?
Yes, but it shortens the available space for all the texts (which could
cause some of them to become two lines, but I didn't check) and it means
the translations have to be updated.
The translations will get broken either way, so that doesn't seem like
much of an argument. As for length, only \z seems to be in trouble and
that could probably be shortened.
regards, tom lane
2. the help.c patch no longer applies
3. the help.c patch breaks alignment of the help output
Attached is a patch to fix problems 2 and 3: help.c clean application and
formatting of the output therein. I also put \z right after \dp and removed
the duplicate wording, to make it fit better, per comments in this thread.
--
Greg Sabino Mullane
Attachments:
backslash_consistency.v2.patchtext/x-patch; name=backslash_consistency.v2.patchDownload+158-125
Import Notes
Reply to msg id not found: 2e25321a0c919943859c59dfdfa07af5@biglumber.comReference msg id not found: 2e25321a0c919943859c59dfdfa07af5@biglumber.com | Resolved by subject fallback
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.
Patch applied, thanks.
---------------------------------------------------------------------------
Greg Sabino Mullane wrote:
-- Start of PGP signed section.
2. the help.c patch no longer applies
3. the help.c patch breaks alignment of the help output
Attached is a patch to fix problems 2 and 3: help.c clean application and
formatting of the output therein. I also put \z right after \dp and removed
the duplicate wording, to make it fit better, per comments in this thread.--
Greg Sabino Mullane
[ Attachment, skipping... ]
-- End of PGP section, PGP failed!
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Bruce Momjian wrote:
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.Patch applied, thanks.
This patch has annoyed me twice in two days now, and similarly with
other people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?
--On Donnerstag, Januar 15, 2009 17:51:35 +0200 Peter Eisentraut
<peter_e@gmx.net> wrote:
This patch has annoyed me twice in two days now, and similarly with other
people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?
I'd like to second this. It makes looking for specific functions and/or
other objects really awful, especially if you accidently forgot the S and
you're getting to think this function doesn't even exist....
--
Thanks
Bernd
Peter Eisentraut wrote:
Bruce Momjian wrote:
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.Patch applied, thanks.
This patch has annoyed me twice in two days now, and similarly with
other people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?
Well, \dT is even worse. ;-) (How many users have user-defined types?)
The basic goal of the patch was to make 'S' consistent for all \d
backslash commands, and we had a lot of discussion about it, and many
people asked for it (I can't find my user functions). It is hard to
argue that our previous behavior was logical (though perhaps useful).
The only thing I can suggest at this point is some kind of setting that
defaults to 'S' for psql \d commands, but that is going to affect \dt as
well.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Peter Eisentraut <peter_e@gmx.net> writes:
This patch has annoyed me twice in two days now, and similarly with
other people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?
I agree, this change mostly sucks, and particularly with respect to \df.
regards, tom lane
Bruce Momjian wrote:
Peter Eisentraut wrote:
Bruce Momjian wrote:
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.Patch applied, thanks.
This patch has annoyed me twice in two days now, and similarly with
other people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?Well, \dT is even worse. ;-) (How many users have user-defined types?)
The basic goal of the patch was to make 'S' consistent for all \d
backslash commands, and we had a lot of discussion about it, and many
people asked for it (I can't find my user functions). It is hard to
argue that our previous behavior was logical (though perhaps useful).
Consistency is nice, but I'm used to typing \df pg_foobar() as well.
Could we make plain "\df" list only user functions, but "\df XXX" search
for system functions as well? And the same for all \d* commands, for the
consistency.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
Heikki Linnakangas wrote:
Bruce Momjian wrote:
Peter Eisentraut wrote:
Bruce Momjian wrote:
Here's an updated version of the psql backslash patch that should
apply cleanly to the current HEAD. To recap, this makes all the \dX
commands (most importantly to most: \df) work like \dt does, in that it
requires a \dXS to see system items. See the archives for much more
discussion on the issue.Patch applied, thanks.
This patch has annoyed me twice in two days now, and similarly with
other people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?Well, \dT is even worse. ;-) (How many users have user-defined types?)
The basic goal of the patch was to make 'S' consistent for all \d
backslash commands, and we had a lot of discussion about it, and many
people asked for it (I can't find my user functions). It is hard to
argue that our previous behavior was logical (though perhaps useful).Consistency is nice, but I'm used to typing \df pg_foobar() as well.
Could we make plain "\df" list only user functions, but "\df XXX" search
for system functions as well? And the same for all \d* commands, for the
consistency.
That makes sense; let me work on that.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Bruce Momjian <bruce@momjian.us> writes:
The basic goal of the patch was to make 'S' consistent for all \d
backslash commands, and we had a lot of discussion about it, and many
people asked for it (I can't find my user functions).
I think this falls in the category of "be careful what you wish for,
you might get it". It is now blindingly obvious that the folks asking
for that had not actually lived with the behavior for any period of
time.
Personally I think we should just revert the patch and go back to the
behavior we've had for umpteen years. However, if you cannot bear to
leave well enough alone, how about *reversing* the sense --- that is,
default behavior is to show everything and there is an extra character
to omit system objects?
regards, tom lane
Tom Lane wrote:
Bruce Momjian <bruce@momjian.us> writes:
The basic goal of the patch was to make 'S' consistent for all \d
backslash commands, and we had a lot of discussion about it, and many
people asked for it (I can't find my user functions).I think this falls in the category of "be careful what you wish for,
you might get it". It is now blindingly obvious that the folks asking
for that had not actually lived with the behavior for any period of
time.Personally I think we should just revert the patch and go back to the
behavior we've had for umpteen years. However, if you cannot bear to
leave well enough alone, how about *reversing* the sense --- that is,
default behavior is to show everything and there is an extra character
to omit system objects?
I got several emails thanking me for applying the patch, so there is
clearly user-demand for 'S'. I think _we_ as developers look at the
system stuff a lot but in user-land, they would rather not see it by
default.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
This patch has annoyed me twice in two days now, and similarly with
other people I know. Having to type \dfS now is about the worst loss of
usability in psql that I can recall. Can we reconsider or revert this?
The problem is that you, me, and the people we know are the only ones
who actually use \df to see system functions. 99.99% of users don't care,
or don't even know, about the system functions - but they do care about
being able to view /their/ functions. So from a usability perspective,
asking a small minority of users to learn to type an extra character is
a small price to pay for a great leap in usability for everyone else.
Frankly, the previous behavior was simply broken: there was no way to
see all your functions (unless they happened to live in a single
schema, then you could do the non-intuituve and annoying \df schemaname.)
For the record, many of the people *I* know, including many 'hackers',
like this change a lot.
- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200901151139
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----
iEYEAREDAAYFAklvaAkACgkQvJuQZxSWSshpJQCbB5LbrjuP1Q9CcYAkdh6xLnoC
kSsAoLvXVnGqJLi1RfnmIgzn/VRVjF9B
=Twyv
-----END PGP SIGNATURE-----
Tom Lane wrote:
Bruce Momjian <bruce@momjian.us> writes:
The basic goal of the patch was to make 'S' consistent for all \d
backslash commands, and we had a lot of discussion about it, and many
people asked for it (I can't find my user functions).I think this falls in the category of "be careful what you wish for,
you might get it". It is now blindingly obvious that the folks asking
for that had not actually lived with the behavior for any period of
time.Personally I think we should just revert the patch and go back to the
behavior we've had for umpteen years. However, if you cannot bear to
leave well enough alone, how about *reversing* the sense --- that is,
default behavior is to show everything and there is an extra character
to omit system objects?
(apologies if I didn't read the thread carefully enough to realize what
it was about - it may be that we're talking about a different behavior
than I'm referring to here...)
Are you saying that "\dt" should include all system tables, for example?
I'd find that a very bad thing...
In fact, just to chime in on the opposite side of people here, I think
that having "\df" just return the user defined functions is a *good*
thing, one that I've wanted. Now, if I do "\df pg_something", I'd still
like it to include system ones.. But finding your own user function in
the plain \df list is horrible.
//Magnus
On Thu, 2009-01-15 at 11:45 -0500, Bruce Momjian wrote:
Tom Lane wrote:
Bruce Momjian <bruce@momjian.us> writes:
I got several emails thanking me for applying the patch, so there is
clearly user-demand for 'S'. I think _we_ as developers look at the
system stuff a lot but in user-land, they would rather not see it by
default.
+1.
Joshua D. Drake
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com+ If your life is a hard drive, Christ can be your backup. +
--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997
Bruce Momjian <bruce@momjian.us> writes:
Tom Lane wrote:
I think this falls in the category of "be careful what you wish for,
you might get it". It is now blindingly obvious that the folks asking
for that had not actually lived with the behavior for any period of
time.
I got several emails thanking me for applying the patch, so there is
clearly user-demand for 'S'.
Were any of them from people who had actually *used* the patch for more
than five minutes? I think this is clearly a case of allowing abstract
consistency considerations to override usability.
The real problem here is that the 'S' suffix for \dt is a bad precedent
for everything else. If you want consistency then we need to change
that end of things. I think that the idea of a switch to omit system
objects, rather than include them, might work.
regards, tom lane