Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 45A061337BDD for ; Thu, 3 Mar 2011 04:59:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 11068-05 for ; Thu, 3 Mar 2011 08:59:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 8C60A1337BD9 for ; Thu, 3 Mar 2011 04:59:23 -0400 (AST) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p238xNRN043783 for ; Thu, 3 Mar 2011 08:59:23 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p238xNGA043782; Thu, 3 Mar 2011 08:59:23 GMT (envelope-from www) Date: Thu, 3 Mar 2011 08:59:23 GMT Message-Id: <201103030859.p238xNGA043782@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5910: Function pg_get_expr throwing error for non superuser From: "tushar" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201103/19 X-Sequence-Number: 29529 The following bug has been logged online: Bug reference: 5910 Logged by: tushar Email address: tushar.qa@gmail.com PostgreSQL version: 9.0.2 Operating system: RHEL-5 32 bit Description: Function pg_get_expr throwing error for non superuser Details: Pls refer this below scenario PG 8.4.4:- ========= connect to non superuser :- postgres=# \c - t psql (8.4.4) You are now connected to database "postgres" as user "t". postgres=> select pg_get_expr('a',null); pg_get_expr ------------- (1 row) postgres=> PG 9.0.2 ========= connect to non superuser :- postgres=# \c - t You are now connected to database "postgres" as user "t". postgres=> select pg_get_expr('a',null); ERROR: argument to pg_get_expr() must come from system catalogs postgres=> Workaround:- if user is superuser then it is working fine.. I found a thread somewhat related to this above issue :- http://archives.postgresql.org/pgsql-hackers/2010-07/msg00503.php which look fixed now in PG 9.0.2 e.g:- postgres=> SELECT pg_get_expr(proargdefaults, 'pg_catalog.pg_class'::regclass) FROM pg_proc pr LEFT OUTER JOIN pg_description des ON des.objoid=pr.oid limit 0; pg_get_expr ------------- (0 rows) postgres=> so i feel this query :-select pg_get_expr('a',null); should also work in PG 9.0.2 but it is not working. is this an expected behavior?