Permissions to create casts

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Permissions to create casts
Date: 2002-07-11 18:32:21
Message-ID: Pine.LNX.4.44.0207111957290.21510-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

What should be the permissions required to create a cast?

Currently, it's approximately first come, first serve. You probably need
to have execute privilege on the function, but that is the least concern.

With no permissions required on either the source or the target type, it's
easy to boobytrap the entire system by creating bogus casting functions.

Given the current granularity of the permissions on data types we'd need
to require the user to own both the source and the target type, which
would make the entire effort quite useless.

Even if we had a "usage" privilege on types, I'm not sure if that would be
appropriate, because creating a cast function is really more than usage --
it affects how the type behaves.

So I'm afraid this might even need to be a separate privilege altogether.

SQL99 effectively says that you must own the source type, the target type,
and the cast function, unless a type is not "user-defined", which is a
distinction we don't make.

Comments?

--
Peter Eisentraut peter_e(at)gmx(dot)net

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2002-07-11 18:34:04 Re: workaround for lack of REPLACE() function
Previous Message Andy Kopciuch 2002-07-11 18:09:52 Re: please help on query