You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Allow "SET list_guc TO NULL" to specify setting the GUC to empty.
We have never had a SET syntax that allows setting a GUC_LIST_INPUTparameter to be an empty list. A locution such asSET search_path = '';doesn't mean that; it means setting the GUC to contain a single itemthat is an empty string. (For search_path the net effect is much thesame, because search_path ignores invalid schema names and '' must beinvalid.) This is confusing, not least because configuration-fileentries and the set_config() function can easily produce empty-listvalues.We considered making the empty-string syntax do this, but that wouldforeclose ever allowing empty-string items to be valid in list GUCs.While there isn't any obvious use-case for that today, it feels likethe kind of restriction that might hurt someday. Instead, let'saccept the forbidden-up-to-now value NULL and treat that as meaning anempty list. (An objection to this could be "what if we someday wantto allow NULL as a GUC value?". That seems unlikely though, and evenif we did allow it for scalar GUCs, we could continue to treat it asmeaning an empty list for list GUCs.)Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Andrei Klychkov <andrew.a.klychkov@gmail.com>Reviewed-by: Jim Jones <jim.jones@uni-muenster.de>Discussion:https://postgr.es/m/CA+mfrmwsBmYsJayWjc8bJmicxc3phZcHHY=yW5aYe=P-1d_4bg@mail.gmail.com
Copy file name to clipboardExpand all lines: doc/src/sgml/ref/set.sgml
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ PostgreSQL documentation
21
21
22
22
<refsynopsisdiv>
23
23
<synopsis>
24
-
SET [ SESSION | LOCAL ] <replaceable class="parameter">configuration_parameter</replaceable> { TO | = } { <replaceable class="parameter">value</replaceable>| '<replaceable class="parameter">value</replaceable>' | DEFAULT }
25
-
SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="parameter">value</replaceable> |'<replaceable class="parameter">value</replaceable>' |LOCAL | DEFAULT }
24
+
SET [ SESSION | LOCAL ] <replaceable class="parameter">configuration_parameter</replaceable> { TO | = } { <replaceable class="parameter">value</replaceable>[, ...] | DEFAULT }
25
+
SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="parameter">value</replaceable> | LOCAL | DEFAULT }
26
26
</synopsis>
27
27
</refsynopsisdiv>
28
28
@@ -123,7 +123,7 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="parameter">value</replac
Copy file name to clipboardExpand all lines: src/test/regress/expected/rules.out
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3572,6 +3572,7 @@ CREATE FUNCTION func_with_set_params() RETURNS integer
3572
3572
SET extra_float_digits TO 2
3573
3573
SET work_mem TO '4MB'
3574
3574
SET datestyle to iso, mdy
3575
+
SET temp_tablespaces to NULL
3575
3576
SET local_preload_libraries TO "Mixed/Case", 'c:/''a"/path', '', '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
SET local_preload_libraries TO 'Mixed/Case', 'c:/''a"/path', '', '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'+