Re: psql UPDATE field [tab] expands to DEFAULT? - Mailing list pgsql-general

From Jeff Janes
Subject Re: psql UPDATE field [tab] expands to DEFAULT?
Date
Msg-id CAMkU=1yycATjA4Ti7d=t8i9HV-3iN9iC8yQpBsZANc+-GUxn8w@mail.gmail.com
Whole thread Raw
In response to Re: psql UPDATE field [tab] expands to DEFAULT?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Mon, Jun 17, 2019 at 8:23 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 6/17/19 4:33 PM, Ken Tanzer wrote:
>
> Thanks Adrian, though I wasn't really seeking tips for column names.  I
> was instead trying to understand whether this particular tab expansion
> was intentional and considered useful, and if so what that usefulness

If I am following the below correctly it is intentional:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/psql/tab-complete.c;h=68a2ba27aec22302625c5481a8f74cf866f4dc23;hb=d22ca701a39dfd03cdfa1ca238370d34f4bc4ac4

Line 2888

But that portion doesn't offer the DEFAULT completion.  It stops at offering '=', and goes no further.

It is at line 2859 which accidentally offers to complete DEFAULT, and that is not part of the UPDATE-specific code.
 
Cheers,

Jeff

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Inserts restricted to a trigger
Next
From: Tom Lane
Date:
Subject: Re: psql UPDATE field [tab] expands to DEFAULT?