Re: has_table_priviledge - Mailing list pgsql-general

From ahoward
Subject Re: has_table_priviledge
Date
Msg-id Pine.LNX.4.53.0304242201410.9051@eli.fsl.noaa.gov
Whole thread Raw
In response to Re: has_table_priviledge  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: has_table_priviledge  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, 24 Apr 2003, Tom Lane wrote:

> ahoward <ahoward@fsl.noaa.gov> writes:
> > grib_tables=# select has_table_priviledge('ahoward','btrel','update');
> > ERROR:  Function 'has_table_priviledge(unknown, unknown, unknown)' does not exist
>
> Right syntax, wrong function name --- there's no "d" in "privilege".
>
>             regards, tom lane

;-)

long day... the error message sure wasn't helpfull though, i finally figured
that one out... any idea why this doesn't work?

  create table vtrcs_co_l
  (
    relname text,
    who name default current_user,
    time timestamp(0) without time zone default current_timestamp,

    primary key (relname),
    foreign key (relname)
      references btrel (relname),

    constraint c0 check
      (has_table_privilege(username, relname, 'update'))
  );

it creates the table, but an insert of

  insert into vtrcs_co_l values('parameter');

fails with

  ERROR:  text_oid: error in "parameter": can't parse "parameter"

which is very odd since

  select has_table_privilege('parameter', current_user, current_timestamp);

does not.  incidentally

  insert into vtrcs_co_l values('parameter', current_user, current_timestamp);

fails as well with the same error.

thanks.

-a


--
  ====================================
  | Ara Howard
  | NOAA Forecast Systems Laboratory
  | Information and Technology Services
  | Data Systems Group
  | R/FST 325 Broadway
  | Boulder, CO 80305-3328
  | Email: ara.t.howard@fsl.noaa.gov
  | Phone:  303-497-7238
  | Fax:    303-497-7259
  ====================================


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] rewriting values with before trigger
Next
From: Dennis Gearon
Date:
Subject: Re: C++ and v7.3.2