pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ken Tanzer <ken.tanzer@gmail.com>
To: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: psql UPDATE field [tab] expands to DEFAULT?
Date: Mon, 17 Jun 2019 16:24:43 -0700
Message-ID: <b70db19f-d582-0d1a-5b4d-15ea385781a4@aklaver.com> (raw)
In-Reply-To: <CAD3a31XpXzrZA9TT3BqLSHghdTK+=cXjNCE+oL2Zn4+oWoc=qA@mail.gmail.com>
References: <CAD3a31XpXzrZA9TT3BqLSHghdTK+=cXjNCE+oL2Zn4+oWoc=qA@mail.gmail.com>

On 6/17/19 3:03 PM, Ken Tanzer wrote:
> Hi.  If I'm using psql, and type for example:
> 
> UPDATE my_table SET my_field
> (with a trailing space)
> 
> and then hit Tab, it will expand that to an =, and then another tab will 
> expand to DEFAULT, so that I then have:
> 
> UPDATE my_table SET my_field = DEFAULT
> 
> If I'm tabbing out in this situation, it's going to be after the =, and 
> I will have typed "myreal"[tab] in the vain hope that psql will complete 
> that to "myreallylongfieldname," but instead it gets replaced with DEFAULT.
> 
> So I'm curious if this is intended behavior, if it's considered useful, 
> and/or if it's a placeholder for something in the future that will be 
> useful.  Also, is this new, as I've never noticed it before?

Not sure how long that has been around.

My cheat for dealing with many/long column names is:

test=# \d up_test
               Table "public.up_test"
  Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------
  id     | integer |           |          |
  col1   | boolean |           |          |
  col2   | integer |           |          |



test=# \pset format unaligned
Output format is unaligned.
test=# \pset fieldsep ','
Field separator is ",".

select * from up_test limit 0;
id,col1,col2

Cut and paste above.

test=# \pset fieldsep '|'
Field separator is "|".

test=# \pset format 'aligned'
Output format is aligned.


> 
> Thanks in advance,
> Ken
> 
> p.s.,  Version 9.6.13
> 
> -- 
> AGENCY Software
> A Free Software data system
> By and for non-profits
> /http://agency-software.org//
> /https://demo.agency-software.org/client/
> ken.tanzer@agency-software.org <mailto:ken.tanzer@agency-software.org>
> (253) 245-3801
> 
> Subscribe to the mailing list 
> <mailto:agency-general-request@lists.sourceforge.net?body=subscribe> to
> learn more about AGENCY or
> follow the discussion.


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (14+ messages)  latest in thread

Message-ID: <b70db19f-d582-0d1a-5b4d-15ea385781a4@aklaver.com>
Permalink:  ../b70db19f-d582-0d1a-5b4d-15ea385781a4@aklaver.com/
Also on:    postgresql.org/message-id/b70db19f-d582-0d1a-5b4d-15ea385781a4@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ken.tanzer@gmail.com
  Subject: Re: psql UPDATE field [tab] expands to DEFAULT?
  In-Reply-To: <b70db19f-d582-0d1a-5b4d-15ea385781a4@aklaver.com>
  References: <CAD3a31XpXzrZA9TT3BqLSHghdTK+=cXjNCE+oL2Zn4+oWoc=qA@mail.gmail.com> <b70db19f-d582-0d1a-5b4d-15ea385781a4@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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