Difference between revisions of "PostgreSQL SET"

From wikieduonline
Jump to navigation Jump to search
 
(11 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
* https://www.postgresql.org/docs/current/sql-set.html
 
* https://www.postgresql.org/docs/current/sql-set.html
  
 +
SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT }
 +
SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
  
 +
== Examples ==
 
  [[SET SESSION AUTHORIZATION]]  
 
  [[SET SESSION AUTHORIZATION]]  
 +
[[SET TIME ZONE]] 'Europe/Rome';
 +
[[SET SESSION]] [[log_statement]] TO 'all';
 +
 +
[[log_duration]]
  
 
  [[SET]] SESSION AUTHORIZATION user_name
 
  [[SET]] SESSION AUTHORIZATION user_name
Line 9: Line 16:
 
  Output:
 
  Output:
 
  SET
 
  SET
 +
 +
[[ALTER]] USER prometheus [[SET]] [[SEARCH_PATH]] TO prometheus,[[pg_catalog]];
  
 
== Related ==
 
== Related ==
 
* [[Redis]]
 
* [[Redis]]
 +
* <code>[[set]]</code>
  
 
== See also ==
 
== See also ==
* {{sed}}
+
* {{PostgreSQL SET}}
 +
* {{SET}}
 
* {{PostgreSQL}}
 
* {{PostgreSQL}}
  
 
[[Category: PostgreSQL]]
 
[[Category: PostgreSQL]]

Latest revision as of 15:09, 17 July 2023

wikipedia:SET change a run-time parameter

SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT }
SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }

Examples[edit]

SET SESSION AUTHORIZATION 
SET TIME ZONE 'Europe/Rome';
SET SESSION log_statement TO 'all'; 
log_duration
SET SESSION AUTHORIZATION user_name

Output:
SET
ALTER USER prometheus SET SEARCH_PATH TO prometheus,pg_catalog;

Related[edit]

See also[edit]

Advertising: