pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
A Small psql Suggestion
7+ messages / 5 participants
[nested] [flat]

* A Small psql Suggestion
@ 2023-01-31 16:17 Raymond Brinzer <ray.brinzer@gmail.com>
  2023-02-01 15:25 ` Re: A Small psql Suggestion Matt Zagrabelny <mzagrabe@d.umn.edu>
  2023-02-01 16:04 ` Re: A Small psql Suggestion hubert depesz lubaczewski <depesz@depesz.com>
  2023-02-08 00:00 ` Re: A Small psql Suggestion Brad White <b55white@gmail.com>
  0 siblings, 3 replies; 7+ messages in thread

From: Raymond Brinzer @ 2023-01-31 16:17 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

Greetings,

There is (for me) a small speed bump in psql.  I think it's worth
mentioning, minor though it is, because psql is such a polished tool
generally, and because it's something which affects me many, many times a
day.

As it is, \d is a shortcut for \dtmvs.  What I actually want to see, on a
regular basis, are my relations:  \dtmv.  Most of the time, the sequences
are clutter.  If my habits are like most people's in this (and I suspect
they are), excluding sequences from \d would optimize for the common case.

Just $0.02, submitted for your gracious consideration.

-- 
Ray Brinzer

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: A Small psql Suggestion
  2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
@ 2023-02-01 15:25 ` Matt Zagrabelny <mzagrabe@d.umn.edu>
  2 siblings, 0 replies; 7+ messages in thread

From: Matt Zagrabelny @ 2023-02-01 15:25 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

At the risk of starting a +1 snowball or a divergent argument...


On Tue, Jan 31, 2023 at 10:16 AM Raymond Brinzer <ray.brinzer@gmail.com>
wrote:

> Greetings,
>
> There is (for me) a small speed bump in psql.  I think it's worth
> mentioning, minor though it is, because psql is such a polished tool
> generally, and because it's something which affects me many, many times a
> day.
>
> As it is, \d is a shortcut for \dtmvs.  What I actually want to see, on a
> regular basis, are my relations:  \dtmv.  Most of the time, the sequences
> are clutter.  If my habits are like most people's in this (and I suspect
> they are), excluding sequences from \d would optimize for the common case.
>

+1

Of course, I don't generally have that many relations that the few
sequences that show up are cause for issue, but it would be nice to not
have to parse them visually.

-m

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: A Small psql Suggestion
  2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
@ 2023-02-01 16:04 ` hubert depesz lubaczewski <depesz@depesz.com>
  2023-02-07 16:44   ` Re: A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
  2 siblings, 1 reply; 7+ messages in thread

From: hubert depesz lubaczewski @ 2023-02-01 16:04 UTC (permalink / raw)
  To: Raymond Brinzer <ray.brinzer@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

On Tue, Jan 31, 2023 at 11:17:16AM -0500, Raymond Brinzer wrote:
> Greetings,
> 
> There is (for me) a small speed bump in psql.  I think it's worth
> mentioning, minor though it is, because psql is such a polished tool
> generally, and because it's something which affects me many, many times a
> day.
> 
> As it is, \d is a shortcut for \dtmvs.  What I actually want to see, on a
> regular basis, are my relations:  \dtmv.  Most of the time, the sequences
> are clutter.  If my habits are like most people's in this (and I suspect
> they are), excluding sequences from \d would optimize for the common case.

Perhaps just add this yourself?
\set d '\\dtmv'
and then
:d

or just bind \dtmv to some key like f1 or something like this?

Best regards,

depesz






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: A Small psql Suggestion
  2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
  2023-02-01 16:04 ` Re: A Small psql Suggestion hubert depesz lubaczewski <depesz@depesz.com>
@ 2023-02-07 16:44   ` Raymond Brinzer <ray.brinzer@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Raymond Brinzer @ 2023-02-07 16:44 UTC (permalink / raw)
  To: depesz@depesz.com; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

I was really busy with work last week, so I didn't get around to thanking
you, depesz.  Setting d is a clever trick which hadn't occurred to me, and
it has indeed made things nicer for me.

I do think it would be a good thing to actually change in psql
nevertheless, since I think the suggested behavior is better most of the
time, especially if all or most of your tables have sequences.  The
built-in ability to work around it (to a good approximation of the desired
behavior) certainly does diminish the importance of the issue, though such
a solution won't be obvious to most people.

Again, though, my thanks.  This has been like a rough spot on the handle of
a tool:  trivial for occasional use, prone to raise a blister over
thousands of repetitions.

On Wed, Feb 1, 2023 at 11:04 AM hubert depesz lubaczewski <depesz@depesz.com>
wrote:

> On Tue, Jan 31, 2023 at 11:17:16AM -0500, Raymond Brinzer wrote:
> > Greetings,
> >
> > There is (for me) a small speed bump in psql.  I think it's worth
> > mentioning, minor though it is, because psql is such a polished tool
> > generally, and because it's something which affects me many, many times a
> > day.
> >
> > As it is, \d is a shortcut for \dtmvs.  What I actually want to see, on a
> > regular basis, are my relations:  \dtmv.  Most of the time, the sequences
> > are clutter.  If my habits are like most people's in this (and I suspect
> > they are), excluding sequences from \d would optimize for the common
> case.
>
> Perhaps just add this yourself?
> \set d '\\dtmv'
> and then
> :d
>
> or just bind \dtmv to some key like f1 or something like this?
>
> Best regards,
>
> depesz
>
>

-- 
Ray Brinzer

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: A Small psql Suggestion
  2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
@ 2023-02-08 00:00 ` Brad White <b55white@gmail.com>
  2023-02-08 00:05   ` Re: A Small psql Suggestion Adrian Klaver <adrian.klaver@aklaver.com>
  2 siblings, 1 reply; 7+ messages in thread

From: Brad White @ 2023-02-08 00:00 UTC (permalink / raw)
  To: ; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

Front end: Access 365
Back end: Postgres 9.4
(I know, we are in the process of upgrading)

I'm getting some cases where the SQL sent from MS-Access is failing.
Looking at the postgres log shows that the field names and table names are
not being quoted properly.
It has been my experience that Access usually does a better job at
converting the queries than I would have expected, but not in this instance.

For example

Access: connection.Execute "UPDATE [" & strTable & "] SET [" & strTable &
"].[InsertFlag] = Null" _
    & " WHERE ((([" & strTable & "].[InsertFlag])=" & lngCurrUID & "));", ,
adCmdText Or adExecuteNoRecords
Note that InsertFlag is bracketed the same way in both instances.

PSQL: UPDATE "public"."Orders" SET InsertFlag=NULL  WHERE ("InsertFlag" =
166 )
Note that InsertFlag is quoted once but not the other time.
Of course this gives the error: column "insertflag" of relation "Order
Items" does not exist at character 35

Any suggestions on where to look?

Thanks,
Brad.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: A Small psql Suggestion
  2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
  2023-02-08 00:00 ` Re: A Small psql Suggestion Brad White <b55white@gmail.com>
@ 2023-02-08 00:05   ` Adrian Klaver <adrian.klaver@aklaver.com>
  2023-02-08 00:14     ` Re: A Small psql Suggestion Brad White <b55white@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Adrian Klaver @ 2023-02-08 00:05 UTC (permalink / raw)
  To: Brad White <b55white@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

On 2/7/23 16:00, Brad White wrote:
> Front end: Access 365
> Back end: Postgres 9.4
> (I know, we are in the process of upgrading)
> 
> I'm getting some cases where the SQL sent from MS-Access is failing.
> Looking at the postgres log shows that the field names and table names 
> are not being quoted properly.
> It has been my experience that Access usually does a better job at 
> converting the queries than I would have expected, but not in this instance.
> 
> For example
> 
> Access: connection.Execute "UPDATE [" & strTable & "] SET [" & strTable 
> & "].[InsertFlag] = Null" _
>      & " WHERE ((([" & strTable & "].[InsertFlag])=" & lngCurrUID & 
> "));", , adCmdText Or adExecuteNoRecords
> Note that InsertFlag is bracketed the same way in both instances.
> 
> PSQL: UPDATE "public"."Orders" SET InsertFlag=NULL  WHERE ("InsertFlag" 
> = 166 )
> Note that InsertFlag is quoted once but not the other time.
> Of course this gives the error: column "insertflag" of relation "Order 
> Items" does not exist at character 35
> 
> Any suggestions on where to look?

1) Do not tack on to an existing thread, create a new post.

2) Where is the query coming from, manually created code or something 
ORM like?

3)
> 
> Thanks,
> Brad.

-- 
Adrian Klaver
adrian.klaver@aklaver.com






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: A Small psql Suggestion
  2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
  2023-02-08 00:00 ` Re: A Small psql Suggestion Brad White <b55white@gmail.com>
  2023-02-08 00:05   ` Re: A Small psql Suggestion Adrian Klaver <adrian.klaver@aklaver.com>
@ 2023-02-08 00:14     ` Brad White <b55white@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Brad White @ 2023-02-08 00:14 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

1) Do not tack on to an existing thread, create a new post.
Yup. Failure on my part.
I'll repost.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2023-02-08 00:14 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31 16:17 A Small psql Suggestion Raymond Brinzer <ray.brinzer@gmail.com>
2023-02-01 15:25 ` Matt Zagrabelny <mzagrabe@d.umn.edu>
2023-02-01 16:04 ` hubert depesz lubaczewski <depesz@depesz.com>
2023-02-07 16:44   ` Raymond Brinzer <ray.brinzer@gmail.com>
2023-02-08 00:00 ` Brad White <b55white@gmail.com>
2023-02-08 00:05   ` Adrian Klaver <adrian.klaver@aklaver.com>
2023-02-08 00:14     ` Brad White <b55white@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox