Skip site navigation (1) Skip section navigation (2)

Re: Re: [COMMITTERS] pgsql: Support comments on FOREIGN DATA WRAPPER and SERVER objects.

From: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
To: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Support comments on FOREIGN DATA WRAPPER and SERVER objects.
Date: 2011-04-04 10:49:09
Message-ID: 20110404194909.5EFE.6989961C@metrosystems.co.jp (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Sun, 3 Apr 2011 10:51:04 +0900
Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com> wrote:
> 2011/4/2 Robert Haas <robertmhaas(at)gmail(dot)com>:
> > On Fri, Apr 1, 2011 at 11:57 AM, Thom Brown <thom(at)linux(dot)com> wrote:
> >> Should we also have support for comments on user mappings?
> >
> > Oh, bugger.  Yeah, probably.
> 
> I'd work on this, if taking some days is OK.

I've worked on this for a while and found some debatable points.

1) Who can comment on a user mapping?
Basically only the owner can comment on a object, but user mappings
don't have owner.  So following rules for ALTER/DROP seems good
because they are similarly allowed to only owner.  In addition to
server's owner, a user can perform ALTER/DROP USER MAPPING if target
mapping is his own user's and USAGE privilege on the server has been
granted.  This means that mappings for PUBLIC can be commented by only
server's owner.  Is this spec reasonable?

2) How to specify user name of the target mapping
ALTER/DROP USER MAPPING also accept USER and CURRENT_USER as current
user.  This syntax seems suitable for COMMENT ON USER MAPPING too for
consistency and usability.

3) Omitting ACL framework support
ISTM that full-support of ACL framework is not necessary for USER
MAPPING because USER MAPPING has no GRANT/REVOKE statements.
COMMENT ON USER MAPPING patch works fine, but some oversight might be
here.

Please see attached patches for details.
Sorry for long patch names, I generated these patches with git
format-patch.

And, attached test_user_mapping_comments.sql is a script which I've
used to test patches locally.

Regards,
--
Shigeru Hanada

Attachment: test_user_mapping_comments.sql
Description: application/octet-stream (3.9 KB)
Attachment: 0005-Fix-psql-to-complete-COMMENT-ON-USER-MAPPING-stateme.patch
Description: application/octet-stream (2.6 KB)
Attachment: 0004-Fix-pg_dump-to-dump-COMMENT-ON-USER-MAPPING-statemen.patch
Description: application/octet-stream (3.3 KB)
Attachment: 0003-Document-about-COMMENT-ON-USER-MAPPING.patch
Description: application/octet-stream (3.8 KB)
Attachment: 0002-Add-regression-tests-for-COMMENT-ON-USER-MAPPING.patch
Description: application/octet-stream (2.7 KB)
Attachment: 0001-Implement-COMMENT-ON-USER-MAPPING.patch
Description: application/octet-stream (7.9 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-04-04 11:02:09
Subject: Re: cast from integer to money
Previous:From: Gabriele BartoliniDate: 2011-04-04 09:11:37
Subject: Uppercase SGML entity declarations

pgsql-committers by date

Next:From: Hiroshi SaitoDate: 2011-04-04 13:31:29
Subject: psqlodbc - psqlodbc: Arrangement of a history.
Previous:From: Robert HaasDate: 2011-04-04 01:53:45
Subject: pgsql: Rearrange "add column" logic to merge columns at exec time.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group