ahoward <ahoward@fsl.noaa.gov> writes:
> On Thu, 24 Apr 2003, Tom Lane wrote:
>> It does work, for me. What PG version are you using, exactly?
> PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.96
Ah. I see it too on 7.2. It looks like the 7.2 parser is choosing
has_table_privilege(name, oid, text) in preference to
has_table_privilege(name, name, text). I can get it to work on 7.2 by
putting in an explicit cast, ie, making the constraint read
constraint c check
(has_table_privilege(user, relname::name, 'update'))
Probably the reason 7.3 doesn't misbehave is that its function is
declared has_table_privilege(name, text, text). That affects the
decision because 'text' is a preferred type and 'name' isn't.
regards, tom lane