Thread

Commits

  1. Fix psql tab-completion for identifiers containing dollars.

  1. Fixing tab-complete for dollar-names

    Mikhail Gribkov <youzhick@gmail.com> — 2023-06-16T21:51:30Z

    Hi hackers,
    
    In modern versions of Postgres the dollar sign is a totally legal character
    for identifiers (except for the first character), but tab-complete do not
    treat such identifiers well.
    For example if one try to create an Oracle-style view like this:
    
    create view v$activity as select * from pg_stat_activity;
    
    , he will get a normally functioning view, but psql tab-complete will not
    help him. Type "v", "v$" or "v$act" and press <TAB> - nothing will be
    suggested.
    
    Attached is a small patch fixing this problem.
    Honestly I'm a little surprised that this was not done before. Maybe, there
    are some special considerations I am not aware of, and the patch will break
    something?
    What would you say?
    --
     best regards,
        Mikhail A. Gribkov
    
  2. Re: Fixing tab-complete for dollar-names

    Mikhail Gribkov <youzhick@gmail.com> — 2023-06-26T20:10:00Z

    Hi hackers,
    
    As not much preliminary interest seem to be here, I'm sending the patch to
    the upcoming commitfest
    
    --
     best regards,
        Mikhail A. Gribkov
    
    
    On Sat, Jun 17, 2023 at 12:51 AM Mikhail Gribkov <youzhick@gmail.com> wrote:
    
    > Hi hackers,
    >
    > In modern versions of Postgres the dollar sign is a totally legal
    > character for identifiers (except for the first character), but
    > tab-complete do not treat such identifiers well.
    > For example if one try to create an Oracle-style view like this:
    >
    > create view v$activity as select * from pg_stat_activity;
    >
    > , he will get a normally functioning view, but psql tab-complete will not
    > help him. Type "v", "v$" or "v$act" and press <TAB> - nothing will be
    > suggested.
    >
    > Attached is a small patch fixing this problem.
    > Honestly I'm a little surprised that this was not done before. Maybe,
    > there are some special considerations I am not aware of, and the patch will
    > break something?
    > What would you say?
    > --
    >  best regards,
    >     Mikhail A. Gribkov
    >
    
  3. Re: Fixing tab-complete for dollar-names

    Vik Fearing <vik@postgresfriends.org> — 2023-06-26T23:47:44Z

    On 6/26/23 22:10, Mikhail Gribkov wrote:
    > Hi hackers,
    > 
    > As not much preliminary interest seem to be here, I'm sending the patch to
    > the upcoming commitfest
    
    I have added myself as reviewer.  I already had taken a look at it, and 
    it seemed okay, but I have not yet searched for corner cases.
    -- 
    Vik Fearing
    
    
    
    
    
  4. Re: Fixing tab-complete for dollar-names

    Heikki Linnakangas <hlinnaka@iki.fi> — 2023-09-19T16:30:25Z

    On 27/06/2023 02:47, Vik Fearing wrote:
    > On 6/26/23 22:10, Mikhail Gribkov wrote:
    >> Hi hackers,
    >>
    >> As not much preliminary interest seem to be here, I'm sending the patch to
    >> the upcoming commitfest
    > 
    > I have added myself as reviewer.  I already had taken a look at it, and
    > it seemed okay, but I have not yet searched for corner cases.
    
    LGTM, pushed.
    
    I concur it's surprising that no one's noticed or at least not bothered 
    to fix this before. But I also couldn't find any cases where this would 
    cause trouble.
    
    -- 
    Heikki Linnakangas
    Neon (https://neon.tech)