postgresql - Postgres: why do some function calls require () and others not? -


my question this: why postgresql functions require empty bracket , others don't , how can tell correct syntax?

examples: not work

select pg_postmaster_start_time; 

results in

error:  column "pg_postmaster_start_time" not exist line 1: select pg_postmaster_start_time;            ^ 

however works:

select pg_postmaster_start_time(); 

resulting in

   pg_postmaster_start_time -------------------------------  2016-08-01 16:07:12.728306+01 (1 row) 

now converse case: works

select current_user; 

and results in

 current_user --------------  edbstore (1 row) 

but not work

select current_user(); 

resulting in

error:  syntax error @ or near "(" line 1: select current_user();                        ^ 

i did find has been asked here, there didn't seem answer

read docs - says

note: current_catalog, current_schema, current_user, session_user, , user have special syntactic status in sql: must called without trailing parentheses. (in postgresql, parentheses can optionally used current_schema, not others.)

i know sounds "because says so", not answer question. how docs explain it.


Comments