Re: Is current_user a function ? - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: Is current_user a function ?
Date
Msg-id 1038501288.54963.16.camel@jester
Whole thread Raw
In response to Is current_user a function ?  (Masaru Sugawara <rk73@sea.plala.or.jp>)
Responses Re: Is current_user a function ?  (Masaru Sugawara <rk73@sea.plala.or.jp>)
List pgsql-hackers
Force the system to use it as a function.

select "current_user"();

On Thu, 2002-11-28 at 11:31, Masaru Sugawara wrote:
> 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)
> 
> 
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
-- 
Rod Taylor <rbt@rbt.ca>



pgsql-hackers by date:

Previous
From: Masaru Sugawara
Date:
Subject: Is current_user a function ?
Next
From: "Merlin Moncure"
Date:
Subject: Re: PostGres and WIN32, a plea!