Skip site navigation (1) Skip section navigation (2)

Is current_user a function ?

From: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Is current_user a function ?
Date: 2002-11-28 16:31:47
Message-ID: 20021129010833.1CFB.RK73@sea.plala.or.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

As for some current_*** functions, "select current_user;" seems to
work, but  "select current_user();" doesn't . Though current_user is
defined as one of functions, why does such an error occur ?

renew=# select current_user();
ERROR:   parser: parse error at or near "(" at character 20


Regards,
Masaru Sugawara


renew=# \df
                                                              List of functions
   Result data type  |   Schema   |         Name          | Argument data types                                                 
---------------------+------------+-----------------------+-----------
 ...
 name                | pg_catalog | current_database      | 
 name                | pg_catalog | current_schema        | 
 name[]              | pg_catalog | current_schemas       | boolean
 text                | pg_catalog | current_setting       | text
 name                | pg_catalog | current_user          | 
 ...


renew=# select current_user();
ERROR:   parser: parse error at or near "(" at character 20

renew=# select current_database();
 current_database 
------------------
 renew
(1 row)

renew=# select current_schema();
 current_schema 
----------------
 public
(1 row)

renew=# select current_schema(true);
   current_schemas   
---------------------
 {pg_catalog,postgres,public}
(1 row)

renew=# select current_schema(false);
   current_schemas   
---------------------
 {postgres,public}
(1 row)

renew=# select current_setting('search_path');
 current_setting 
-----------------
 $user,public
(1 row)







Responses

pgsql-hackers by date

Next:From: Rod TaylorDate: 2002-11-28 16:34:49
Subject: Re: Is current_user a function ?
Previous:From: Bruce MomjianDate: 2002-11-28 16:27:20
Subject: Re: nested transactions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group