Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. psql: Improve tab completion for large objects.

  1. Tab completion for large objects

    Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> — 2025-07-08T18:50:05Z

    Hi hackers,
    
    I noticed that psql's tab completion suggested TO immediately after
    GRANT ... ON LARGE OBJECT, and not after ON LARGE OBJECT <oid>.  This is
    because LARGE OBJECT is the only two-word object type, so it thinks
    LARGE is the object type and OBJECT is the name.  Attached are three
    patches that address this and other LO-related tab completion issues:
    
     1. Tab complete OBJECT after GRANT|REVOKE ... ON LARGE, and TO/FROM
        after GRANT|REVOKE ... ON LARGE OBJECT
    
     2. Tab complete filenames after \lo_export <oid>
    
     3. Tab complete large object OIDs where relevant.  This is less useful
        than completing names like for other objects, but it might still
        be handy.  Separate patch in case it proves controversial or is
        deemed useless.
    
    - ilmari
    
    
  2. Re: Tab completion for large objects

    Fujii Masao <masao.fujii@oss.nttdata.com> — 2025-07-09T10:45:56Z

    
    On 2025/07/09 3:50, Dagfinn Ilmari Mannsåker wrote:
    > Hi hackers,
    > 
    > I noticed that psql's tab completion suggested TO immediately after
    > GRANT ... ON LARGE OBJECT, and not after ON LARGE OBJECT <oid>.  This is
    > because LARGE OBJECT is the only two-word object type, so it thinks
    > LARGE is the object type and OBJECT is the name.  Attached are three
    > patches that address this and other LO-related tab completion issues:
    > 
    >   1. Tab complete OBJECT after GRANT|REVOKE ... ON LARGE, and TO/FROM
    >      after GRANT|REVOKE ... ON LARGE OBJECT
    
    Thanks for the patches!
    
    Regarding the 0001 patch, Nagata-san already proposed a similar patch in [1].
    His version handles not only "LARGE OBJECT" but also another two-word object type,
    "FOREIGN SERVER".
    
    Regards,
    
    [1] https://postgr.es/m/20250611135737.bb7d3135141248819704ebca@sraoss.co.jp
    
    -- 
    Fujii Masao
    NTT DATA Japan Corporation
    
    
    
    
    
  3. Re: Tab completion for large objects

    Fujii Masao <masao.fujii@gmail.com> — 2025-07-27T07:00:01Z

    On Wed, Jul 9, 2025 at 7:46 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
    >
    >
    >
    > On 2025/07/09 3:50, Dagfinn Ilmari Mannsåker wrote:
    > > Hi hackers,
    > >
    > > I noticed that psql's tab completion suggested TO immediately after
    > > GRANT ... ON LARGE OBJECT, and not after ON LARGE OBJECT <oid>.  This is
    > > because LARGE OBJECT is the only two-word object type, so it thinks
    > > LARGE is the object type and OBJECT is the name.  Attached are three
    > > patches that address this and other LO-related tab completion issues:
    > >
    > >   1. Tab complete OBJECT after GRANT|REVOKE ... ON LARGE, and TO/FROM
    > >      after GRANT|REVOKE ... ON LARGE OBJECT
    >
    > Thanks for the patches!
    >
    > Regarding the 0001 patch, Nagata-san already proposed a similar patch in [1].
    > His version handles not only "LARGE OBJECT" but also another two-word object type,
    > "FOREIGN SERVER".
    
    I think it's worth applying patch 0002 and part of 0001, so I've merged
    those changes into a single patch. Patch attached. Any thoughts?
    
    
    +               else if (TailMatches("LARGE"))
    +                       COMPLETE_WITH("OBJECT");
    
    It seems the "ALTER DEFAULT PRIVILEGES ... LARGE" case was missed
    here. In that context, we should complete with "OBJECTS" instead of
    "OBJECT". I've fixed that in the patch.
    
    
    As for patch 0003, I'm not sure it adds much value. It's probably hard
    for most users to choose the correct OID from the list of large object
    OIDs provided by tab-completion.
    
    Regards,
    
    -- 
    Fujii Masao
    
  4. Re: Tab completion for large objects

    Fujii Masao <masao.fujii@gmail.com> — 2025-10-23T07:22:39Z

    On Sun, Jul 27, 2025 at 4:00 PM Fujii Masao <masao.fujii@gmail.com> wrote:
    > I think it's worth applying patch 0002 and part of 0001, so I've merged
    > those changes into a single patch. Patch attached. Any thoughts?
    >
    >
    > +               else if (TailMatches("LARGE"))
    > +                       COMPLETE_WITH("OBJECT");
    >
    > It seems the "ALTER DEFAULT PRIVILEGES ... LARGE" case was missed
    > here. In that context, we should complete with "OBJECTS" instead of
    > "OBJECT". I've fixed that in the patch.
    
    Attached is the rebased version of the patch.
    
    Regards,
    
    -- 
    Fujii Masao
    
  5. Re: Tab completion for large objects

    Chao Li <li.evan.chao@gmail.com> — 2025-10-23T09:22:18Z

    
    > On Oct 23, 2025, at 15:22, Fujii Masao <masao.fujii@gmail.com> wrote:
    > 
    > On Sun, Jul 27, 2025 at 4:00 PM Fujii Masao <masao.fujii@gmail.com> wrote:
    >> I think it's worth applying patch 0002 and part of 0001, so I've merged
    >> those changes into a single patch. Patch attached. Any thoughts?
    >> 
    >> 
    >> +               else if (TailMatches("LARGE"))
    >> +                       COMPLETE_WITH("OBJECT");
    >> 
    >> It seems the "ALTER DEFAULT PRIVILEGES ... LARGE" case was missed
    >> here. In that context, we should complete with "OBJECTS" instead of
    >> "OBJECT". I've fixed that in the patch.
    > 
    > Attached is the rebased version of the patch.
    > 
    > Regards,
    > 
    > -- 
    > Fujii Masao
    > <v3-0001-psql-Improve-tab-completion-for-large-object.patch>
    
    The code change is solid. One tidy comment on the commit subject and message:
    
    ```
    Subject: [PATCH v3] psql: Improve tab completion for large object.
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    This commit enhances psql's tab completion support for a large object:
    ```
    
    I think we can use “large objects” in the both places. Because completion can be “OBJECT” or “OBJECTS”. And a comment uses “objects”:
    
    ```
     	/*
     	 * Complete "GRANT/REVOKE * ON DATABASE/DOMAIN/..." with a list of
    -	 * appropriate objects.
    +	 * appropriate objects or keywords.
    ```
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
    
    
    
    
    
    
    
  6. Re: Tab completion for large objects

    Fujii Masao <masao.fujii@gmail.com> — 2025-10-24T05:34:35Z

    On Thu, Oct 23, 2025 at 6:23 PM Chao Li <li.evan.chao@gmail.com> wrote:
    > The code change is solid. One tidy comment on the commit subject and message:
    
    I've updated the commit message as suggested and pushed the patch. Thanks!
    
    Regards,
    
    -- 
    Fujii Masao
    
    
    
    
  7. Re: Tab completion for large objects

    Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> — 2025-10-24T10:04:05Z

    Fujii Masao <masao.fujii@gmail.com> writes:
    
    > On Thu, Oct 23, 2025 at 6:23 PM Chao Li <li.evan.chao@gmail.com> wrote:
    >> The code change is solid. One tidy comment on the commit subject and message:
    >
    > I've updated the commit message as suggested and pushed the patch. Thanks!
    
    Thanks!
    
    - ilmari