X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 78E9F52834 for ; Wed, 25 May 2005 09:58:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84295-03 for ; Wed, 25 May 2005 12:58:07 +0000 (GMT) Received: from klub.chip.pl (klub.chip.pl [62.87.136.3]) by svr1.postgresql.org (Postfix) with ESMTP id AADDA52841 for ; Wed, 25 May 2005 09:58:05 -0300 (ADT) Received: from klub.chip.pl (dell-klub.prod [10.10.0.108]) by klub.chip.pl (Postfix) with SMTP id 38AD33462EF for ; Wed, 25 May 2005 14:55:03 +0200 (CEST) Received: from 213.77.90.234 (SquirrelMail authenticated user przygoda) by klub.chip.pl with HTTP; Wed, 25 May 2005 14:55:03 +0200 (CEST) Message-ID: <55336.213.77.90.234.1117025703.squirrel@klub.chip.pl> Date: Wed, 25 May 2005 14:55:03 +0200 (CEST) Subject: Permissions + Views + Functions = relation not exist when not owner From: "Adie" To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-2 X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.212 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/213 X-Sequence-Number: 21526 HI! I got a View which calls function which uses table. It works fine when selecting from view by owner (postgres) of table, function and view. Problem is when another user is sellecting view. There is an error: ERROR: relation "XXX" does not exist CONTEXT: PL/pgSQL function "XXX" line 4 at select into variables User has rights to select from view, use schema AND function is declared as IMMUTABLE CALLED ON NULL INPUT SECURITY DEFINER It is strange it looks like problem with permission but error is not about permissions. Calling function directly also produces error. Functions and Views are in separate schema but tables are in "public". Any idea why this is happening? Using pg7.4.6 Martin Domanski