Unix Technical Forum

psql backslash consistency

This is a discussion on psql backslash consistency within the Pgsql Patches forums, part of the PostgreSQL category; --> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Attached is my "backslash consistency" patch which basically makes all the backslash commands ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:22 AM
Greg Sabino Mullane
 
Posts: n/a
Default psql backslash consistency

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Attached is my "backslash consistency" patch which basically makes all
the backslash commands behave as \dt does: \d* shows non-system objects,
and \d*S shows system objects. See the archives for more discussion on
this. I wrote this patch some time ago, and have been meaning to work on
enhancing the tab-completion stuff more. However, I'm going to leave it
as it is for now[1], and I've updated my patch to the recent cvs. This
was done hastily, so it definitely needs a looking over.

[1] I'd like to eventually fix psql so that \di [tab] only lists schemas
that actually contain possible indexes (or indexes), rather than the
current behavior which is to just list all schemas.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200505261242
http://biglumber.com/x/web?pk=2529DF...9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFClfyjvJuQZxSWSsgRAv4aAJ48KPwfzYGpU80KcjS9/obMqKMK0wCgx+M0
hCAJLpFXpj72anOnb+2E0yg=
=ezLT
-----END PGP SIGNATURE-----



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:22 AM
Tom Lane
 
Posts: n/a
Default Re: psql backslash consistency

Greg Sabino Mullane <greg@turnstep.com> writes:
> Attached is my "backslash consistency" patch which basically makes all
> the backslash commands behave as \dt does: \d* shows non-system objects,
> and \d*S shows system objects.


Could we have a way to turn this off? At least for functions and
operators? For my usage, at least, this will be a serious step
backwards in usefulness.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:22 AM
Peter Eisentraut
 
Posts: n/a
Default Re: psql backslash consistency

Tom Lane wrote:
> Greg Sabino Mullane <greg@turnstep.com> writes:
> > Attached is my "backslash consistency" patch which basically makes
> > all the backslash commands behave as \dt does: \d* shows non-system
> > objects, and \d*S shows system objects.

>
> Could we have a way to turn this off? At least for functions and
> operators? For my usage, at least, this will be a serious step
> backwards in usefulness.


I see hardly any use case for showing only user-defined functions or
types by default. I think consistency is not necessarily desirable
here.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:22 AM
Robert Treat
 
Posts: n/a
Default Re: psql backslash consistency

On Fri, 2005-05-27 at 03:45, Peter Eisentraut wrote:
> Tom Lane wrote:
> > Greg Sabino Mullane <greg@turnstep.com> writes:
> > > Attached is my "backslash consistency" patch which basically makes
> > > all the backslash commands behave as \dt does: \d* shows non-system
> > > objects, and \d*S shows system objects.

> >
> > Could we have a way to turn this off? At least for functions and
> > operators? For my usage, at least, this will be a serious step
> > backwards in usefulness.


Do you have an implementation in mind? I'm having trouble coming up with
a way to do it cleanly.

>
> I see hardly any use case for showing only user-defined functions or
> types by default. I think consistency is not necessarily desirable
> here.
>


See the archives for previous discussion and/or use cases.


Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 12:22 AM
Tom Lane
 
Posts: n/a
Default Re: psql backslash consistency

Robert Treat <xzilla@users.sourceforge.net> writes:
> Do you have an implementation in mind? I'm having trouble coming up with
> a way to do it cleanly.


A psql \set variable to choose the behavior seems like a reasonable
compromise. Perhaps it could list the \d commands that should include
system objects by default --- that would give considerable customization
flexibility.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 12:22 AM
Alvaro Herrera
 
Posts: n/a
Default Re: psql backslash consistency

On Fri, May 27, 2005 at 01:58:05PM -0400, Robert Treat wrote:
> On Fri, 2005-05-27 at 03:45, Peter Eisentraut wrote:
> > Tom Lane wrote:
> > > Greg Sabino Mullane <greg@turnstep.com> writes:
> > > > Attached is my "backslash consistency" patch which basically makes
> > > > all the backslash commands behave as \dt does: \d* shows non-system
> > > > objects, and \d*S shows system objects.
> > >
> > > Could we have a way to turn this off? At least for functions and
> > > operators? For my usage, at least, this will be a serious step
> > > backwards in usefulness.

>
> Do you have an implementation in mind? I'm having trouble coming up with
> a way to do it cleanly.


How about a psql config option? It should default to show only
non-system objects, as that is the most generally useful behavior.

--
Alvaro Herrera (<alvherre[a]surnet.cl>)
A male gynecologist is like an auto mechanic who never owned a car.
(Carrie Snow)

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 12:22 AM
Peter Eisentraut
 
Posts: n/a
Default Re: psql backslash consistency

Robert Treat wrote:
> > I see hardly any use case for showing only user-defined functions
> > or types by default. I think consistency is not necessarily
> > desirable here.

>
> See the archives for previous discussion and/or use cases.


I didn't find any. Nevertheless, while there are undoubtedly some uses
for everything, making this the default behavior does not seem
acceptable.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 12:22 AM
Tom Lane
 
Posts: n/a
Default Re: psql backslash consistency

Alvaro Herrera <alvherre@surnet.cl> writes:
> How about a psql config option? It should default to show only
> non-system objects, as that is the most generally useful behavior.


There seems to be a distinct lack of unanimity about that judgment ;-)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-18-2008, 12:22 AM
Bruce Momjian
 
Posts: n/a
Default Re: psql backslash consistency

Peter Eisentraut wrote:
> Robert Treat wrote:
> > > I see hardly any use case for showing only user-defined functions
> > > or types by default. I think consistency is not necessarily
> > > desirable here.

> >
> > See the archives for previous discussion and/or use cases.

>
> I didn't find any. Nevertheless, while there are undoubtedly some uses
> for everything, making this the default behavior does not seem
> acceptable.


I think the logical issue is that a database with no user tables is
useless/empty, so showing only user tables makes sense, while a database
with no user functions is still useful, and in fact I would think most
databases have no user functions.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-18-2008, 12:22 AM
Robert Treat
 
Posts: n/a
Default Re: psql backslash consistency

On Friday 27 May 2005 15:09, Peter Eisentraut wrote:
> Robert Treat wrote:
> > > I see hardly any use case for showing only user-defined functions
> > > or types by default. I think consistency is not necessarily
> > > desirable here.

> >
> > See the archives for previous discussion and/or use cases.

>
> I didn't find any. Nevertheless, while there are undoubtedly some uses
> for everything, making this the default behavior does not seem
> acceptable.


ISTM it is more acceptable than you're willing to admit.

http://archives.postgresql.org/pgsql...4/msg00009.php
http://archives.postgresql.org/pgsql...4/msg00102.php
http://archives.postgresql.org/pgsql...9/msg00199.php

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:12 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com