Thread: problems updating table

problems updating table

From
"Johnson, Shaunn"
Date:

Howdy:

Running PostgrSQL 7.2.1 on RedHat Linux 7.2.

I'm trying to update a table and I'm getting permission
denied from what seems to be a totally unrelated
table.

I am logged on as the table owner and I'm getting this
message:

[snip error]

test=> \dt sys_users
     List of relations
   Name    | Type  | Owner
-----------+-------+-------
 sys_users | table | web
(1 row)

test=> \dp sys_users
              Access privileges for database "bcn"
   Table   |                 Access privileges
-----------+----------------------------------------------------
 sys_users | {=r,web=arwdRxt,hmp=arwdRxt,"group staff=arwdRxt"}

test=> \c test web
You are now connected to database bcn as user web.

test=> update sys_users set "username"='MARISSA' where "username"='marissa';
ERROR:  hmp_mbrhlth: Permission denied.

test=> \dt hmp_mbrhlth
      List of relations
    Name     | Type  | Owner
-------------+-------+-------
 hmp_mbrhlth | table | hmp

[/snip error]

I've done this before and I believe I'm using the correct
syntax.  I've even tried to get brave and do it as 'postgres'
and I still have errors.

What am I missing?

Thanks!

-X

Re: problems updating table

From
Stephan Szabo
Date:
On Thu, 12 Dec 2002, Johnson, Shaunn wrote:

> test=> update sys_users set "username"='MARISSA' where "username"='marissa';
> ERROR:  hmp_mbrhlth: Permission denied.
>
> test=> \dt hmp_mbrhlth
>       List of relations
>     Name     | Type  | Owner
> -------------+-------+-------
>  hmp_mbrhlth | table | hmp
>
> [/snip error]
>
>
> I've done this before and I believe I'm using the correct
> syntax.  I've even tried to get brave and do it as 'postgres'
> and I still have errors.
>
> What am I missing?

How are sys_users and hmp_mbrhlth defined?  Specifically, are there
any triggers, rules or foreign keys potentially involved?


Re: problems updating table

From
"Johnson, Shaunn"
Date:

--thanks for the reply.

--my first thought was that somehow there is a
--foreign key or maybe a trigger between the two
--tables, but, i'm not really sure of what all that means.

--i am looking at pg_trigger and i see something like this:

[snip from pg_trigger]

460078110 | RI_ConstraintTrigger_460078127  |   1644 |     21 | t         | t              | <unnamed>    |     16871088

5 | f            | f              |       6 |        | <unnamed>\000hmp_mbrhlth\000sys_users\000UNSPECIFIED\000username\00

0username\000
  168710885 | RI_ConstraintTrigger_460078129  |   1654 |      9 | t         | t              | <unnamed>    |     46007811

0 | f            | f              |       6 |        | <unnamed>\000hmp_mbrhlth\000sys_users\000UNSPECIFIED\000username\00

0username\000
  168710885 | RI_ConstraintTrigger_460078131  |   1655 |     17 | t         | t              | <unnamed>    |     46007811

0 | f            | f              |       6 |        | <unnamed>\000hmp_mbrhlth\000sys_users\000UNSPECIFIED\000username\00

0username\000

[/snip trigger]

--but, i'm not sure as to how this effect editing / updating sys_users. 

--can someone point to the docs that explain why i can't update a table
--when there is a trigger set for that same table?  i don't think i'm
--even close in explaining myself, but basically:  what does triggers have
--to do with anything?

--thanks!

-X

-----Original Message-----
From: Stephan Szabo [mailto:sszabo@megazone23.bigpanda.com]

> test=> update sys_users set "username"='MARISSA' where "username"='marissa';
> ERROR:  hmp_mbrhlth: Permission denied.
>
> test=> \dt hmp_mbrhlth
>       List of relations
>     Name     | Type  | Owner
> -------------+-------+-------
>  hmp_mbrhlth | table | hmp
>
> [/snip error]
>
>
> I've done this before and I believe I'm using the correct
> syntax.  I've even tried to get brave and do it as 'postgres'
> and I still have errors.
>
> What am I missing?

How are sys_users and hmp_mbrhlth defined?  Specifically, are there
any triggers, rules or foreign keys potentially involved?