Re: psql: \dl+ to list large objects privileges - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: psql: \dl+ to list large objects privileges
Date
Msg-id 20220104062417.GA14051@telsasoft.com
Whole thread Raw
In response to psql: \dl+ to list large objects privileges  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Responses Re: psql: \dl+ to list large objects privileges
List pgsql-hackers
On Tue, Aug 31, 2021 at 05:14:12PM +0300, Pavel Luzanov wrote:
> I decided to move the do_lo_list function to describe.c in order to use the
> printACLColumn helper function. And at the same time I renamed do_lo_list to
> listLargeObjects to unify with the names of other similar functions.

The tabs were changed to spaces when you moved the function.

I suggest to move the function in a separate 0001 commit, which makes no code
changes other than moving from one file to another.  

A committer would probably push them as a single patch, but this makes it
easier to read and review the changes in 0002.
Possibly like git diff HEAD~:src/bin/psql/large_obj.c src/bin/psql/describe.c

> +        if (pset.sversion >= 90000)

Since a few weeks ago, psql no longer supports server versions before 9.2, so
the "if" branch can go away.

> I don't like how I handled the + modifier in the \lo_list command. But I
> don't know how to do better now. This is the second time I've programmed in
> C. The first time was the 'Hello World' program. So maybe something is done
> wrong.

I think everywhere else just uses verbose = strchr(cmd, '+') != 0;

-- 
Justin



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Inconsistent ellipsis in regression test error message?
Next
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication