Re: [PATCH] Add size/acl information when listing databases

From: Andrew Gilligan <andy(at)tcpd(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add size/acl information when listing databases
Date: 2008-01-20 05:27:05
Message-ID: 7269E86B-552C-4E5F-B993-4CAAA7255644@tcpd.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 20 Jan 2008, at 04:34, Tom Lane wrote:
> Andrew Gilligan <andy(at)tcpd(dot)net> writes:
>> Showing the size on \l+ probably makes more sense, but I imagine that
>> would require a very different approach due to the permissions
>> changes?
>
> I haven't experimented, but perhaps something along the lines of
>
> case when has_database_privilege(current_user, db.oid, 'connect')
> then pg_database_size...
> else null
> end
>
> would fix it.

Yep, that seems to do the trick.

I've attached an updated patch (based on 8.3RC2) that adds the ACL
information to \l and the size to \l+ if available.

Best regards,
-Andy

Attachment Content-Type Size
patch-83rc2-src-bin-psql-describe.c.diff application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jon Hancock 2008-01-20 08:21:01 SHA1 on postgres 8.3
Previous Message Tom Lane 2008-01-20 04:34:17 Re: [PATCH] Add size/acl information when listing databases