head	1.95;
access;
symbols
	REL9_0_0:1.95
	REL9_1_ALPHA1:1.95
	REL9_0_RC1:1.95
	REL9_0_BETA4:1.95
	REL9_0_STABLE:1.95.0.2
	REL9_0_BETA3:1.95
	REL9_0_BETA2:1.95
	REL7_4_29:1.83
	REL8_0_25:1.86
	REL8_1_21:1.86
	REL8_2_17:1.90
	REL8_3_11:1.91
	REL8_4_4:1.94
	REL9_0_BETA1:1.95
	REL9_0_ALPHA5_BRANCH:1.94.0.12
	REL9_0_ALPHA5:1.94
	REL7_4_28:1.83
	REL8_0_24:1.86
	REL8_1_20:1.86
	REL8_2_16:1.90
	REL8_3_10:1.91
	REL8_4_3:1.94
	REL9_0_ALPHA4:1.94
	REL9_0_ALPHA4_BRANCH:1.94.0.10
	REL8_5_ALPHA3:1.94
	REL8_5_ALPHA3_BRANCH:1.94.0.8
	REL7_4_27:1.83
	REL8_0_23:1.86
	REL8_1_19:1.86
	REL8_2_15:1.90
	REL8_3_9:1.91
	REL8_4_2:1.94
	REL8_5_ALPHA2:1.94
	REL8_5_ALPHA2_BRANCH:1.94.0.6
	REL7_4_26:1.83
	REL8_0_22:1.86
	REL8_1_18:1.86
	REL8_2_14:1.90
	REL8_3_8:1.91
	REL8_4_1:1.94
	REL8_5_ALPHA1:1.94
	REL8_5_ALPHA1_BRANCH:1.94.0.4
	REL8_4_STABLE:1.94.0.2
	REL8_4_0:1.94
	REL8_4_RC2:1.94
	REL8_4_RC1:1.94
	REL8_4_BETA2:1.94
	REL8_4_BETA1:1.94
	REL7_4_25:1.83
	REL8_0_21:1.86
	REL8_1_17:1.86
	REL8_2_13:1.90
	REL8_3_7:1.91
	REL7_4_24:1.83
	REL8_0_20:1.86
	REL8_1_16:1.86
	REL8_2_12:1.90
	REL8_3_6:1.91
	REL7_4_23:1.83
	REL8_0_19:1.86
	REL8_1_15:1.86
	REL8_2_11:1.90
	REL8_3_5:1.91
	REL7_4_22:1.83
	REL8_0_18:1.86
	REL8_1_14:1.86
	REL8_2_10:1.90
	REL8_3_4:1.91
	REL7_4_21:1.83
	REL8_0_17:1.86
	REL8_1_13:1.86
	REL8_2_9:1.90
	REL8_3_3:1.91
	REL7_4_20:1.83
	REL8_0_16:1.86
	REL8_1_12:1.86
	REL8_2_8:1.90
	REL8_3_2:1.91
	REL8_2_7:1.90
	REL8_3_1:1.91
	REL8_3_STABLE:1.91.0.2
	REL8_3_0:1.91
	REL8_3_RC2:1.91
	REL7_3_21:1.68
	REL7_4_19:1.83
	REL8_0_15:1.86
	REL8_1_11:1.86
	REL8_2_6:1.90
	REL8_3_RC1:1.91
	REL8_3_BETA4:1.91
	REL8_3_BETA3:1.91
	REL8_3_BETA2:1.91
	REL8_3_BETA1:1.91
	REL7_3_20:1.68
	REL7_4_18:1.83
	REL8_0_14:1.86
	REL8_1_10:1.86
	REL8_2_5:1.90
	REL7_3_19:1.68
	REL7_4_17:1.83
	REL8_0_13:1.86
	REL8_1_9:1.86
	REL8_2_4:1.90
	REL8_0_12:1.86
	REL8_1_8:1.86
	REL8_2_3:1.90
	REL7_3_18:1.68
	REL7_4_16:1.83
	REL8_0_11:1.86
	REL8_1_7:1.86
	REL8_2_2:1.90
	REL8_0_10:1.86
	REL8_1_6:1.86
	REL8_2_1:1.90
	REL7_4_15:1.83
	REL7_3_17:1.68
	REL8_2_STABLE:1.90.0.2
	REL8_2_0:1.90
	REL8_2_RC1:1.90
	REL8_2_BETA3:1.90
	REL8_2_BETA2:1.90
	REL8_1_5:1.86
	REL8_0_9:1.86
	REL7_4_14:1.83
	REL7_3_16:1.68
	REL8_2_BETA1:1.90
	REL7_3_15:1.68
	REL7_4_13:1.83
	REL8_0_8:1.86
	REL8_1_4:1.86
	REL7_3_14:1.68
	REL7_4_12:1.83
	REL8_0_7:1.86
	REL8_1_3:1.86
	REL7_3_13:1.68
	REL7_4_11:1.83
	REL8_0_6:1.86
	REL8_1_2:1.86
	REL7_3_12:1.68
	REL7_4_10:1.83
	REL8_0_5:1.86
	REL8_1_1:1.86
	REL8_1_STABLE:1.86.0.6
	REL8_1_0:1.86
	REL8_1_0RC1:1.86
	REL8_1_0BETA4:1.86
	REL8_1_0BETA3:1.86
	REL7_3_11:1.68
	REL7_4_9:1.83
	REL8_0_4:1.86
	REL8_1_0BETA2:1.86
	REL8_1_0BETA1:1.86
	REL7_2_8:1.57
	REL7_3_10:1.68
	REL7_4_8:1.83
	REL8_0_3:1.86
	REL8_0_2:1.86
	REL7_2_7:1.57
	REL7_3_9:1.68
	REL7_4_7:1.83
	REL8_0_1:1.86
	REL8_0_STABLE:1.86.0.4
	REL8_0_0:1.86.0.2
	REL8_0_0RC5:1.86
	REL8_0_0RC4:1.86
	REL8_0_0RC3:1.86
	REL8_0_0RC2:1.86
	REL8_0_0RC1:1.86
	REL8_0_0BETA5:1.86
	REL8_0_0BETA4:1.86
	REL7_4_6:1.83
	REL7_3_8:1.68
	REL7_2_6:1.57
	REL8_0_0BETA3:1.86
	REL8_0_0BETA2:1.86
	REL7_2_5:1.57
	REL7_4_5:1.83
	REL7_3_7:1.68
	REL7_4_4:1.83
	REL8_0_0BETA1:1.85
	REL7_4_3:1.83
	REL7_4_2:1.83
	REL7_3_6:1.68
	REL7_4_1:1.83
	REL7_3_5:1.68
	REL7_4:1.83
	REL7_4_RC2:1.83
	REL7_4_STABLE:1.83.0.2
	REL7_4_RC1:1.83
	REL7_4_BETA5:1.83
	REL7_4_BETA4:1.83
	REL7_4_BETA3:1.82
	REL7_4_BETA2:1.80
	WIN32_DEV:1.80.0.2
	REL7_4_BETA1:1.80
	REL7_3_4:1.68
	REL7_3_2:1.68
	REL7_2_4:1.57
	REL7_3_STABLE:1.68.0.2
	REL7_2_3:1.57
	REL7_2_STABLE:1.57.0.2
	REL7_2:1.57
	REL7_2_RC2:1.57
	REL7_2_RC1:1.57
	REL7_2_BETA5:1.57
	REL7_2_BETA4:1.54
	REL7_2_BETA3:1.53
	REL7_2_BETA2:1.53
	REL7_2_BETA1:1.53
	REL7_1_2:1.52
	REL7_1_STABLE:1.52.0.2
	REL7_1_BETA:1.50
	REL7_1_BETA3:1.50
	REL7_1_BETA2:1.50
	REL7_1:1.52
	REL7_0_PATCHES:1.43.0.2
	REL7_0:1.42
	REL6_5_PATCHES:1.25.0.2
	REL6_5:1.25
	REL6_4:1.6.0.2;
locks; strict;
comment	@# @;


1.95
date	2010.04.03.07.23.02;	author petere;	state Exp;
branches;
next	1.94;

1.94
date	2008.11.14.10.22.47;	author petere;	state Exp;
branches;
next	1.93;

1.93
date	2008.10.27.09.37.47;	author petere;	state Exp;
branches;
next	1.92;

1.92
date	2008.03.10.12.39.22;	author tgl;	state Exp;
branches;
next	1.91;

1.91
date	2007.09.11.00.06.41;	author tgl;	state Exp;
branches;
next	1.90;

1.90
date	2006.09.22.16.20.00;	author tgl;	state Exp;
branches;
next	1.89;

1.89
date	2006.09.16.00.30.20;	author momjian;	state Exp;
branches;
next	1.88;

1.88
date	2006.04.25.14.56.04;	author momjian;	state Exp;
branches;
next	1.87;

1.87
date	2006.04.25.14.47.29;	author momjian;	state Exp;
branches;
next	1.86;

1.86
date	2004.08.10.00.55.08;	author tgl;	state Exp;
branches;
next	1.85;

1.85
date	2004.08.03.20.32.32;	author tgl;	state Exp;
branches;
next	1.84;

1.84
date	2003.11.29.19.51.39;	author pgsql;	state Exp;
branches;
next	1.83;

1.83
date	2003.09.22.00.16.58;	author petere;	state Exp;
branches;
next	1.82;

1.82
date	2003.09.12.00.12.47;	author tgl;	state Exp;
branches;
next	1.81;

1.81
date	2003.08.31.17.32.24;	author petere;	state Exp;
branches;
next	1.80;

1.80
date	2003.07.29.00.03.17;	author tgl;	state Exp;
branches
	1.80.2.1;
next	1.79;

1.79
date	2003.07.17.00.55.36;	author tgl;	state Exp;
branches;
next	1.78;

1.78
date	2003.07.15.19.19.56;	author tgl;	state Exp;
branches;
next	1.77;

1.77
date	2003.06.21.19.33.36;	author tgl;	state Exp;
branches;
next	1.76;

1.76
date	2003.05.14.03.26.00;	author tgl;	state Exp;
branches;
next	1.75;

1.75
date	2003.05.04.02.23.16;	author petere;	state Exp;
branches;
next	1.74;

1.74
date	2003.04.25.19.45.08;	author tgl;	state Exp;
branches;
next	1.73;

1.73
date	2003.03.25.16.15.44;	author petere;	state Exp;
branches;
next	1.72;

1.72
date	2003.01.19.00.13.31;	author momjian;	state Exp;
branches;
next	1.71;

1.71
date	2003.01.12.01.33.00;	author momjian;	state Exp;
branches;
next	1.70;

1.70
date	2003.01.11.17.03.45;	author momjian;	state Exp;
branches;
next	1.69;

1.69
date	2003.01.11.00.39.52;	author momjian;	state Exp;
branches;
next	1.68;

1.68
date	2002.10.13.16.55.05;	author tgl;	state Exp;
branches;
next	1.67;

1.67
date	2002.10.09.16.27.48;	author momjian;	state Exp;
branches;
next	1.66;

1.66
date	2002.10.09.04.59.38;	author momjian;	state Exp;
branches;
next	1.65;

1.65
date	2002.09.21.18.32.54;	author petere;	state Exp;
branches;
next	1.64;

1.64
date	2002.08.04.05.09.36;	author momjian;	state Exp;
branches;
next	1.63;

1.63
date	2002.08.04.03.53.11;	author momjian;	state Exp;
branches;
next	1.62;

1.62
date	2002.06.11.15.41.30;	author thomas;	state Exp;
branches;
next	1.61;

1.61
date	2002.05.18.15.44.47;	author petere;	state Exp;
branches;
next	1.60;

1.60
date	2002.05.17.01.19.16;	author tgl;	state Exp;
branches;
next	1.59;

1.59
date	2002.04.21.19.02.39;	author thomas;	state Exp;
branches;
next	1.58;

1.58
date	2002.02.26.15.59.08;	author tgl;	state Exp;
branches;
next	1.57;

1.57
date	2002.01.07.02.29.15;	author petere;	state Exp;
branches;
next	1.56;

1.56
date	2001.12.29.20.29.49;	author momjian;	state Exp;
branches;
next	1.55;

1.55
date	2001.12.29.18.35.54;	author thomas;	state Exp;
branches;
next	1.54;

1.54
date	2001.12.08.03.24.39;	author thomas;	state Exp;
branches;
next	1.53;

1.53
date	2001.09.03.12.57.50;	author petere;	state Exp;
branches;
next	1.52;

1.52
date	2001.03.05.19.00.01;	author petere;	state Exp;
branches;
next	1.51;

1.51
date	2001.03.05.18.42.57;	author momjian;	state Exp;
branches;
next	1.50;

1.50
date	2000.10.05.19.48.19;	author momjian;	state Exp;
branches;
next	1.49;

1.49
date	2000.09.12.21.12.45;	author momjian;	state Exp;
branches;
next	1.48;

1.48
date	2000.08.29.20.02.09;	author momjian;	state Exp;
branches;
next	1.47;

1.47
date	2000.08.07.00.51.18;	author tgl;	state Exp;
branches;
next	1.46;

1.46
date	2000.07.14.15.27.14;	author thomas;	state Exp;
branches;
next	1.45;

1.45
date	2000.06.18.21.24.52;	author petere;	state Exp;
branches;
next	1.44;

1.44
date	2000.06.09.01.44.00;	author momjian;	state Exp;
branches;
next	1.43;

1.43
date	2000.05.18.14.24.33;	author momjian;	state Exp;
branches;
next	1.42;

1.42
date	2000.04.18.15.23.34;	author thomas;	state Exp;
branches;
next	1.41;

1.41
date	2000.04.14.23.12.29;	author momjian;	state Exp;
branches;
next	1.40;

1.40
date	2000.04.14.15.17.28;	author thomas;	state Exp;
branches;
next	1.39;

1.39
date	2000.04.11.17.23.35;	author momjian;	state Exp;
branches;
next	1.38;

1.38
date	2000.04.11.03.49.04;	author momjian;	state Exp;
branches;
next	1.37;

1.37
date	2000.04.08.23.12.01;	author momjian;	state Exp;
branches;
next	1.36;

1.36
date	2000.04.07.13.31.18;	author thomas;	state Exp;
branches;
next	1.35;

1.35
date	2000.03.31.17.45.32;	author tgl;	state Exp;
branches;
next	1.34;

1.34
date	2000.03.31.03.20.17;	author thomas;	state Exp;
branches;
next	1.33;

1.33
date	2000.03.26.18.32.27;	author petere;	state Exp;
branches;
next	1.32;

1.32
date	2000.03.17.05.29.03;	author tgl;	state Exp;
branches;
next	1.31;

1.31
date	2000.02.27.21.07.03;	author tgl;	state Exp;
branches;
next	1.30;

1.30
date	2000.02.19.08.14.54;	author thomas;	state Exp;
branches;
next	1.29;

1.29
date	2000.02.15.20.49.07;	author tgl;	state Exp;
branches;
next	1.28;

1.28
date	99.07.22.15.09.15;	author thomas;	state Exp;
branches;
next	1.27;

1.27
date	99.07.15.16.31.16;	author thomas;	state Exp;
branches;
next	1.26;

1.26
date	99.07.14.20.32.58;	author thomas;	state Exp;
branches;
next	1.25;

1.25
date	99.07.06.17.17.31;	author thomas;	state Exp;
branches
	1.25.2.1;
next	1.24;

1.24
date	99.06.17.15.15.48;	author momjian;	state Exp;
branches;
next	1.23;

1.23
date	99.06.14.07.37.05;	author thomas;	state Exp;
branches;
next	1.22;

1.22
date	99.06.09.13.43.42;	author thomas;	state Exp;
branches;
next	1.21;

1.21
date	99.06.08.20.01.01;	author vadim;	state Exp;
branches;
next	1.20;

1.20
date	99.06.04.15.50.44;	author thomas;	state Exp;
branches;
next	1.19;

1.19
date	99.06.04.03.44.41;	author momjian;	state Exp;
branches;
next	1.18;

1.18
date	99.06.03.20.45.08;	author momjian;	state Exp;
branches;
next	1.17;

1.17
date	99.06.03.20.44.28;	author momjian;	state Exp;
branches;
next	1.16;

1.16
date	99.06.03.20.42.16;	author momjian;	state Exp;
branches;
next	1.15;

1.15
date	99.06.03.18.37.59;	author momjian;	state Exp;
branches;
next	1.14;

1.14
date	99.06.03.18.18.41;	author momjian;	state Exp;
branches;
next	1.13;

1.13
date	99.05.20.05.40.27;	author thomas;	state Exp;
branches;
next	1.12;

1.12
date	99.03.07.12.00.36;	author momjian;	state Exp;
branches;
next	1.11;

1.11
date	99.02.18.06.00.42;	author momjian;	state Exp;
branches;
next	1.10;

1.10
date	99.02.14.04.56.44;	author momjian;	state Exp;
branches;
next	1.9;

1.9
date	99.02.02.20.30.05;	author momjian;	state Exp;
branches;
next	1.8;

1.8
date	99.02.02.03.43.56;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	98.12.29.02.24.46;	author thomas;	state Exp;
branches;
next	1.6;

1.6
date	98.10.30.19.34.36;	author thomas;	state Exp;
branches;
next	1.5;

1.5
date	98.10.21.05.34.11;	author thomas;	state Exp;
branches;
next	1.4;

1.4
date	98.10.14.16.31.28;	author thomas;	state Exp;
branches;
next	1.3;

1.3
date	98.10.14.05.09.56;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	98.09.25.13.42.43;	author thomas;	state Exp;
branches;
next	1.1;

1.1
date	98.09.01.15.53.09;	author thomas;	state Exp;
branches;
next	;

1.25.2.1
date	99.07.16.05.51.42;	author thomas;	state Exp;
branches;
next	;

1.80.2.1
date	2003.09.07.04.36.46;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.95
log
@Remove unnecessary xref endterm attributes and title ids

The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
@
text
@<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.94 2008/11/14 10:22:47 petere Exp $
PostgreSQL documentation
-->

<refentry id="SQL-SET">
 <refmeta>
  <refentrytitle>SET</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>SET</refname>
  <refpurpose>change a run-time parameter</refpurpose>
 </refnamediv>

 <indexterm zone="sql-set">
  <primary>SET</primary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
SET [ SESSION | LOCAL ] <replaceable class="PARAMETER">configuration_parameter</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</replaceable> | LOCAL | DEFAULT }
</synopsis>
 </refsynopsisdiv>
 
 <refsect1>
  <title>Description</title>

  <para>
   The <command>SET</command> command changes run-time configuration
   parameters.  Many of the run-time parameters listed in
   <xref linkend="runtime-config"> can be changed on-the-fly with
   <command>SET</command>.
   (But some require superuser privileges to change, and others cannot
   be changed after server or session start.)
   <command>SET</command> only affects the value used by the current
   session.
  </para>

  <para>
   If <command>SET</command> (or equivalently <command>SET SESSION</command>)
   is issued within a transaction that is later aborted, the effects of the
   <command>SET</command> command disappear when the transaction is rolled
   back.  Once the surrounding transaction is committed, the effects
   will persist until the end of the session, unless overridden by another
   <command>SET</command>.
  </para>

  <para>
   The effects of <command>SET LOCAL</command> last only till the end of
   the current transaction, whether committed or not.  A special case is
   <command>SET</command> followed by <command>SET LOCAL</command> within
   a single transaction: the <command>SET LOCAL</command> value will be
   seen until the end of the transaction, but afterwards (if the transaction
   is committed) the <command>SET</command> value will take effect.
  </para>

  <para>
   The effects of <command>SET</command> or <command>SET LOCAL</command> are
   also canceled by rolling back to a savepoint that is earlier than the
   command.
  </para>

  <para>
   If <command>SET LOCAL</command> is used within a function that has a
   <literal>SET</> option for the same variable (see
   <xref linkend="sql-createfunction">),
   the effects of the <command>SET LOCAL</command> command disappear at
   function exit; that is, the value in effect when the function was called is
   restored anyway.  This allows <command>SET LOCAL</command> to be used for
   dynamic or repeated changes of a parameter within a function, while still
   having the convenience of using the <literal>SET</> option to save and
   restore the caller's value.  However, a regular <command>SET</> command
   overrides any surrounding function's <literal>SET</> option; its effects
   will persist unless rolled back.
  </para>

  <note>
   <para>
    In <productname>PostgreSQL</productname> versions 8.0 through 8.2,
    the effects of a <command>SET LOCAL</command> would be canceled by
    releasing an earlier savepoint, or by successful exit from a
    <application>PL/pgSQL</application> exception block.  This behavior
    has been changed because it was deemed unintuitive.
   </para>
  </note>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><literal>SESSION</></term>
    <listitem>
     <para>
      Specifies that the command takes effect for the current session.
      (This is the default if neither <literal>SESSION</> nor
      <literal>LOCAL</> appears.)
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>LOCAL</></term>
    <listitem>
     <para>
      Specifies that the command takes effect for only the current
      transaction.  After <command>COMMIT</> or <command>ROLLBACK</>,
      the session-level setting takes effect again.  Note that
      <command>SET LOCAL</> will appear to have no effect if it is
      executed outside a <command>BEGIN</> block, since the
      transaction will end immediately.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="PARAMETER">configuration_parameter</replaceable></term>
    <listitem>
     <para>
      Name of a settable run-time parameter.  Available parameters are
      documented in <xref linkend="runtime-config"> and below.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="PARAMETER">value</replaceable></term>
    <listitem>
     <para>
      New value of parameter.  Values can be specified as string
      constants, identifiers, numbers, or comma-separated lists of
      these, as appropriate for the particular parameter.
      <literal>DEFAULT</literal> can be written to specify
      resetting the parameter to its default value (that is, whatever
      value it would have had if no <command>SET</> had been executed
      in the current session).
     </para>
    </listitem>
   </varlistentry>
  </variablelist>

  <para>
   Besides the configuration parameters documented in <xref
   linkend="runtime-config">, there are a few that can only be
   adjusted using the <command>SET</command> command or that have a
   special syntax:

   <variablelist>
    <varlistentry>
     <term><literal>SCHEMA</literal></term>
     <listitem>
      <para>
       <literal>SET SCHEMA '<replaceable>value</>'</> is an alias for
       <literal>SET search_path TO <replaceable>value</></>.  Only one
       schema can be specified using this syntax.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><literal>NAMES</literal></term>
     <listitem>
      <para>
       <literal>SET NAMES <replaceable>value</></> is an alias for
       <literal>SET client_encoding TO <replaceable>value</></>.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><literal>SEED</literal></term>
     <listitem>
      <para>
       Sets the internal seed for the random number generator (the
       function <function>random</function>).  Allowed values are
       floating-point numbers between -1 and 1, which are then
       multiplied by 2<superscript>31</>-1.
      </para>

      <para>
       The seed can also be set by invoking the function
       <function>setseed</function>:
<programlisting>
SELECT setseed(<replaceable>value</replaceable>);
</programlisting>
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><literal>TIME ZONE</literal></term>
     <listitem>
      <para>
       <literal>SET TIME ZONE <replaceable>value</></> is an alias
       for <literal>SET timezone TO <replaceable>value</></>.  The
       syntax <literal>SET TIME ZONE</literal> allows special syntax
       for the time zone specification.  Here are examples of valid
       values:

       <variablelist>
        <varlistentry>
         <term><literal>'PST8PDT'</literal></term>
         <listitem>
          <para>
           The time zone for Berkeley, California.
          </para>
         </listitem>
        </varlistentry>
        <varlistentry>
         <term><literal>'Europe/Rome'</literal></term>
         <listitem>
          <para>
           The time zone for Italy.
          </para>
         </listitem>
        </varlistentry>
        <varlistentry>
         <term><literal>-7</literal></term>
         <listitem>
          <para>
           The time zone 7 hours west from UTC (equivalent
           to PDT).  Positive values are east from UTC.
          </para>
         </listitem>
        </varlistentry>
        <varlistentry>
         <term><literal>INTERVAL '-08:00' HOUR TO MINUTE</literal></term>
         <listitem>
          <para>
           The time zone 8 hours west from UTC (equivalent
           to PST).
          </para>
         </listitem>
        </varlistentry>
        <varlistentry>
         <term><literal>LOCAL</literal></term>
         <term><literal>DEFAULT</literal></term>
         <listitem>
          <para>
           Set the time zone to your local time zone (that is, the
           server's default value of <varname>timezone</>; if this
           has not been explicitly set anywhere, it will be the zone that
           the server's operating system defaults to).
          </para>
         </listitem>
        </varlistentry>
       </variablelist>

       See <xref linkend="datatype-timezones"> for more information
       about time zones.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   The function <function>set_config</function> provides equivalent
   functionality; see <xref linkend="functions-admin">.
   Also, it is possible to UPDATE the
   <link linkend="view-pg-settings"><structname>pg_settings</structname></link>
   system view to perform the equivalent of <command>SET</>.
  </para>
 </refsect1>
 
 <refsect1>
  <title>Examples</title>

  <para>
   Set the schema search path:
<programlisting>
SET search_path TO my_schema, public;
</programlisting>
  </para>

  <para>
   Set the style of date to traditional
   <productname>POSTGRES</productname> with <quote>day before month</>
   input convention:
<screen>
SET datestyle TO postgres, dmy;
</screen>
  </para>

  <para>
   Set the time zone for Berkeley, California:
<screen>
SET TIME ZONE 'PST8PDT';
</screen>
  </para>

  <para>
   Set the time zone for Italy:
<screen>
SET TIME ZONE 'Europe/Rome';
</screen>
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   <literal>SET TIME ZONE</literal> extends syntax defined in the SQL
   standard.  The standard allows only numeric time zone offsets while
   <productname>PostgreSQL</productname> allows more flexible
   time-zone specifications.  All other <literal>SET</literal>
   features are <productname>PostgreSQL</productname> extensions.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="SQL-RESET"></member>
   <member><xref linkend="SQL-SHOW"></member>
  </simplelist>
 </refsect1>
</refentry>
@


1.94
log
@Set SQL man pages to be section 7 by default, and only transform them to
another section if required by the platform (instead of the old way of
building them in section "l" and always transforming them to the
platform-specific section).

This speeds up the installation on common platforms, and it avoids some
funny business with the man page tools and build process.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.93 2008/10/27 09:37:47 petere Exp $
d8 1
a8 1
  <refentrytitle id="SQL-SET-TITLE">SET</refentrytitle>
d70 1
a70 1
   <xref linkend="sql-createfunction" endterm="sql-createfunction-title">),
d325 2
a326 2
   <member><xref linkend="SQL-RESET" endterm="SQL-RESET-title"></member>
   <member><xref linkend="SQL-SHOW" endterm="SQL-SHOW-title"></member>
@


1.93
log
@SQL:2008 syntax CURRENT_CATALOG, CURRENT_SCHEMA, SET CATALOG, SET SCHEMA.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.92 2008/03/10 12:39:22 tgl Exp $
d9 1
@


1.92
log
@Document and enforce that the usable range of setseed() arguments is
-1 to 1, not 0 to 1.  The actual behavior for values within this range
does not change.  Kris Jurka
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.91 2007/09/11 00:06:41 tgl Exp $
d154 11
@


1.91
log
@Arrange for SET LOCAL's effects to persist until the end of the current top
transaction, unless rolled back or overridden by a SET clause for the same
variable attached to a surrounding function call.  Per discussion, these
seem the best semantics.  Note that this is an INCOMPATIBLE CHANGE: in 8.0
through 8.2, SET LOCAL's effects disappeared at subtransaction commit
(leading to behavior that made little sense at the SQL level).

I took advantage of the opportunity to rewrite and simplify the GUC variable
save/restore logic a little bit.  The old idea of a "tentative" value is gone;
it was a hangover from before we had a stack.  Also, we no longer need a stack
entry for every nesting level, but only for those in which a variable's value
actually changed.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.90 2006/09/22 16:20:00 tgl Exp $
d169 1
a169 1
       floating-point numbers between 0 and 1, which are then
@


1.90
log
@Update timezone documentation to reflect current reality: instead of
giving tables of known timezone names, refer the user to the system views.
Joachim Wieland
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.89 2006/09/16 00:30:20 momjian Exp $
d43 2
a44 2
   If <command>SET</command> or <command>SET SESSION</command> is issued
   within a transaction that is later aborted, the effects of the
d46 1
a46 4
   back.  (This behavior represents a change from
   <productname>PostgreSQL</productname> versions prior to 7.3, where
   the effects of <command>SET</command> would not roll back after a later
   error.)  Once the surrounding transaction is committed, the effects
d59 30
d136 5
a140 2
      these.  <literal>DEFAULT</literal> can be used to specify
      resetting the parameter to its default value.
d233 3
a235 1
           Set the time zone to your local time zone (the one that
d256 4
a259 1
   functionality. See <xref linkend="functions-admin">.
@


1.89
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.88 2006/04/25 14:56:04 momjian Exp $
d210 2
a211 3
       See <xref linkend="datatype-datetime"> for more information
       about time zones.  Also, <xref linkend="datetime-appendix">
       has a list of the recognized names for time zones.
@


1.88
log
@Call SET varaiables "configuration_parameter"s in the documentation.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.87 2006/04/25 14:47:29 momjian Exp $
a283 17

<!-- Keep this comment at the end of the file
Local variables:
mode:sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
@


1.87
log
@Change "parameter" to "varname" in the alter role and alter user
documentation sections.  Also update SET/RESET to be consistent.

Nicolas Barbier
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/set.sgml,v 1.86 2004/08/10 00:55:08 tgl Exp $
d23 1
a23 1
SET [ SESSION | LOCAL ] <replaceable class="PARAMETER">varname</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
d94 1
a94 1
    <term><replaceable class="PARAMETER">varname</replaceable></term>
@


1.86
log
@Update documentation to reflect the fact that we now know exactly what
time zone names we support.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/set.sgml,v 1.85 2004/08/03 20:32:32 tgl Exp $
d23 1
a23 1
SET [ SESSION | LOCAL ] <replaceable class="PARAMETER">name</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
d94 1
a94 1
    <term><replaceable class="PARAMETER">name</replaceable></term>
@


1.85
log
@Add functions pg_start_backup, pg_stop_backup to create backup label
and history files as per recent discussion.  While at it, remove
pg_terminate_backend, since we have decided we do not have time during
this release cycle to address the reliability concerns it creates.
Split the 'Miscellaneous Functions' documentation section into
'System Information Functions' and 'System Administration Functions',
which hopefully will draw the eyes of those looking for such things.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/set.sgml,v 1.84 2003/11/29 19:51:39 pgsql Exp $
d161 1
a161 1
       values (but note some are accepted only on some platforms):
a172 8
         <term><literal>'Portugal'</literal></term>
         <listitem>
          <para>
           The time zone for Portugal.
          </para>
         </listitem>
        </varlistentry>
        <varlistentry>
d211 2
a212 1
       about time zones.
d249 1
a249 2
   Set the time zone for Berkeley, California, using quotes to
   preserve the uppercase spelling of the time zone name:
d252 2
a253 1
SELECT current_timestamp AS today;
d255 4
a258 3
             today
-------------------------------
 2003-04-29 15:02:01.218622-07
@


1.84
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
$PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.83 2003/09/22 00:16:58 petere Exp $
d232 1
a232 1
   functionality. See <xref linkend="functions-misc">.
@


1.83
log
@Make the SQL command synopses appear less random.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.82 2003/09/12 00:12:47 tgl Exp $
@


1.82
log
@More cleanup of Diagnostics sections.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.81 2003/08/31 17:32:24 petere Exp $
d23 1
a23 1
SET [ SESSION | LOCAL ] <replaceable class="PARAMETER">variable</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
d94 1
a94 1
    <term><replaceable class="PARAMETER">variable</replaceable></term>
@


1.81
log
@Add/edit index entries.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.80 2003/07/29 00:03:17 tgl Exp $
a224 42
 </refsect1>

 <refsect1>
  <title>Diagnostics</title>

   <variablelist>
    <varlistentry>
     <term><computeroutput>SET</computeroutput></term>
     <listitem>
      <para>
       Message returned if successful.
      </para>
     </listitem>
    </varlistentry>
     
    <varlistentry>
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable>' is not a valid option name</computeroutput></term>
     <listitem>
      <para>
       The parameter you tried to set does not exist.
      </para>
     </listitem>
    </varlistentry>
     
    <varlistentry>
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable>': permission denied</computeroutput></term>
     <listitem>
      <para>
       You must be a superuser to alter certain settings.
      </para>
     </listitem>
    </varlistentry>
     
    <varlistentry>
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable>' cannot be changed after server start</computeroutput></term>
     <listitem>
      <para>
       Some parameters are fixed once the server is started.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
@


1.80
log
@Apply (a somewhat revised version of) Greg Mullane's patch to eliminate
heuristic determination of day vs month in date/time input.  Add the
ability to specify that input is interpreted as yy-mm-dd order (which
formerly worked, but only for yy greater than 31).  DateStyle's input
component now has the preferred spellings DMY, MDY, or YMD; the older
keywords European and US are now aliases for the first two of these.
Per recent discussions on pgsql-general.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.79 2003/07/17 00:55:36 tgl Exp $
d16 4
@


1.80.2.1
log
@Update this branch to match CVS head, includes WIN32 improvements.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.81 2003/08/31 17:32:24 petere Exp $
a15 4

 <indexterm zone="sql-set">
  <primary>SET</primary>
 </indexterm>
@


1.79
log
@Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL convention
for the sign of timezone offsets, ie, positive is east from UTC.  These
were previously out of step with other operations that accept or show
timezones, such as I/O of timestamptz values.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.78 2003/07/15 19:19:56 tgl Exp $
d286 2
a287 1
   <productname>POSTGRES</productname> with European conventions:
d289 1
a289 1
SET datestyle TO postgres,european;
@


1.78
log
@Cause SHOW DATESTYLE to produce a string that will be accepted by SET
DATESTYLE, for instance 'SQL, European' instead of
'SQL with European conventions'.  Per gripe a month or two back from
Barry Lind.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.77 2003/06/21 19:33:36 tgl Exp $
d185 1
a185 1
         <term><literal>7</literal></term>
d189 1
a189 1
           to PDT).  Negative values are east from UTC.
d194 1
a194 1
         <term><literal>INTERVAL '08:00' HOUR TO MINUTE</literal></term>
d208 1
a208 1
           your operating system defaults to).
@


1.77
log
@Fix some markup problems.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.76 2003/05/14 03:26:00 tgl Exp $
d157 1
a157 1
       values:
@


1.76
log
@Backend support for autocommit removed, per recent discussions.  The
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.75 2003/05/04 02:23:16 petere Exp $
d123 1
a123 1
       <literal>>SET NAMES <replaceable>value</></> is an alias for
d153 1
a153 1
       <literal>>SET TIME ZONE <replaceable>value</></> is an alias
d155 1
a155 1
       syntax <literal>>SET TIME ZONE</literal> allows special syntax
d188 2
a189 2
           The time zone to 7 hours offset west from UTC (equivalent
           to PDT).
d197 1
a197 1
           The time zone to 8 hours offset west from UTC (equivalent
@


1.75
log
@Last round of reference page editing.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.74 2003/04/25 19:45:08 tgl Exp $
a56 6
  </para>

  <para>
   Even with <varname>autocommit</> set to <literal>off</>, <command>SET</>
   does not start a new transaction block. See the
   <varname>autocommit</> section in <xref linkend="runtime-config"> for details.
@


1.74
log
@In the continuing saga of FE/BE protocol revisions, add reporting of
initial values and runtime changes in selected parameters.  This gets
rid of the need for an initial 'select pg_client_encoding()' query in
libpq, bringing us back to one message transmitted in each direction
for a standard connection startup.  To allow server version to be sent
using the same GUC mechanism that handles other parameters, invent the
concept of a never-settable GUC parameter: you can 'show server_version'
but it's not settable by any GUC input source.  Create 'lc_collate' and
'lc_ctype' never-settable parameters so that people can find out these
settings without need for pg_controldata.  (These side ideas were all
discussed some time ago in pgsql-hackers, but not yet implemented.)
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.73 2003/03/25 16:15:44 petere Exp $
d11 1
d16 1
d18 1
a18 1
  <synopsis>
d21 1
a21 56
  </synopsis>

  <refsect2 id="R2-SQL-SET-1">
   <title>Inputs</title>
   <para>
    <variablelist>

     <varlistentry>
      <term><option>SESSION</></term>
      <listitem>
       <para>
        Specifies that the command takes effect for the current session.
        (This is the default if neither <option>SESSION</> nor
        <option>LOCAL</> appears.)
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>LOCAL</></term>
      <listitem>
       <para>
        Specifies that the command takes effect for only the current
        transaction.  After <command>COMMIT</> or <command>ROLLBACK</>,
        the session-level setting takes effect again.  Note that
        <command>SET LOCAL</> will appear to have no effect if it's
        executed outside a <command>BEGIN</> block, since the transaction
        will end immediately.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="PARAMETER">variable</replaceable></term>
      <listitem>
       <para>
        Name of a settable run-time parameter.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="PARAMETER">value</replaceable></term>
      <listitem>
       <para>
        New value of parameter.  <option>DEFAULT</option> can be
        used to specify resetting the parameter to its default
        value. Lists of strings are allowed, but more complex
        constructs may need to be single or double quoted.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>

d24 1
a24 1
 <refsect1 id="R1-SQL-SET-1">
d33 1
a33 1
   be changed after server or session start.)  Note that
d64 4
d69 54
a122 2
  <para>
   Here are additional details about a few of the parameters that can be set:
d126 1
a126 1
     <term><varname>DATESTYLE</></term>
d129 2
a130 81
       Choose the date/time representation style. Two separate
       settings are involved: the default date/time output format and the
       interpretation of ambiguous input.
      </para>

      <para>
       The following are date/time output styles:

       <variablelist>
        <varlistentry>
         <term><literal>ISO</></term>
         <listitem>
          <para>
           Use ISO 8601-style dates and times (<literal>YYYY-MM-DD
            HH:MM:SS</literal>). This is the default.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>SQL</></term>
         <listitem>
          <para>
           Use Oracle/Ingres-style dates and times. Note that this
           style has nothing to do with SQL (which mandates ISO 8601
           style); the naming of this option is a historical accident.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>PostgreSQL</></term>
         <listitem>
          <para>
           Use traditional <productname>PostgreSQL</productname> format.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>German</></term>
         <listitem>
          <para>
           Use <literal>dd.mm.yyyy</literal> for numeric date representations.
          </para>
         </listitem>
        </varlistentry>
       </variablelist>
      </para>

      <para>
       The following two options determine both a substyle of the
       <quote>SQL</quote> and <quote>PostgreSQL</quote> output formats
       and the preferred interpretation of ambiguous date input.

       <variablelist>
        <varlistentry>
         <term><literal>European</></term>
         <listitem>
          <para>
           Use <literal>dd/mm/yyyy</literal> for numeric date representations.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>NonEuropean</></term>
         <term><literal>US</></term>
         <listitem>
          <para>
           Use <literal>mm/dd/yyyy</literal> for numeric date representations.
          </para>
         </listitem>
        </varlistentry>
       </variablelist>
      </para>

      <para>
       A value for <command>SET DATESTYLE</command> can be one from
       the first list (output styles), or one from the second list
       (substyles), or one from each separated by a comma.
a131 35

      <para>
       <command>SET DATESTYLE</command> affects interpretation of
       input and provides several standard output formats. For
       applications needing different variations or tighter control
       over input or output, consider using
       the <function>to_char</function> family of
       functions.
      </para>

      <para>
       There are several now-deprecated means for setting the date style
       in addition to the normal methods of setting it via <command>SET</> or
       a configuration-file entry:
       <simplelist>
        <member>
         Setting the postmaster's <envar>PGDATESTYLE</envar> environment
         variable.  (This will be overridden by any of the other methods.)
        </member>
        <member>
         Running postmaster using the option <option>-o -e</option> to
         set dates to the <literal>European</literal> convention.
         (This overrides environment variables and configuration-file
         entries.)
        </member>
        <member>
         Setting the client's <envar>PGDATESTYLE</envar> environment variable.
         If <envar>PGDATESTYLE</envar> is set in the frontend environment of a client
         based on <application>libpq</>, <application>libpq</> will automatically set <varname>DATESTYLE</> to the
         value of <envar>PGDATESTYLE</envar> during connection start-up.  This is
         equivalent to a manually issued <command>SET DATESTYLE</>.
        </member>
       </simplelist>
      </para>

d136 1
a136 1
     <term>NAMES</term>
d139 4
a142 24
       <command>SET NAMES</> is an alias for <command>SET CLIENT_ENCODING</>.
      </para>
     </listitem>
    </varlistentry>

     <varlistentry>
      <term>SEED</term>
      <listitem>
       <para>
       Sets the internal seed for the random number generator.
	
       <variablelist>
        <varlistentry>
         <term><replaceable class="parameter">value</replaceable></term>
         <listitem>
          <para>
           The value for the seed to be used by the
           <function>random</function> function. Allowed
           values are floating-point numbers between 0 and 1, which
           are then multiplied by 2<superscript>31</>-1.
          </para>
         </listitem>
        </varlistentry>
       </variablelist>
d146 3
a148 4
       The seed can also be set by invoking the
       <function>setseed</function> SQL function:

       <programlisting>
d150 1
a150 1
       </programlisting>
d156 1
a156 2
     <term>TIME ZONE</term>
     <term>TIMEZONE</term>
d159 5
a163 8
       Sets the default time zone for your session. Arguments can be
       an SQL time interval constant, an integer or double precision
       constant, or a string representing a time zone name recognized
       by the host operating system.
      </para>

      <para>
       Here are some typical values for time zone settings:
d167 1
a167 1
         <term>'PST8PDT'</term>
d170 1
a170 1
           Set the time zone for Berkeley, California.
d175 1
a175 1
         <term>'Portugal'</term>
d178 1
a178 1
           Set the time zone for Portugal.
d183 1
a183 1
         <term>'Europe/Rome'</term>
d186 1
a186 1
           Set the time zone for Italy.
d191 1
a191 1
         <term>7</term>
d194 1
a194 1
           Set the time zone to 7 hours offset west from GMT (equivalent
d200 1
a200 1
         <term>INTERVAL '08:00' HOUR TO MINUTE</term>
d203 1
a203 1
           Set the time zone to 8 hours offset west from GMT (equivalent
d209 2
a210 2
         <term>LOCAL</term>
         <term>DEFAULT</term>
a218 14
      </para>

      <para>
       The available time zone names depend on your operating
       system. For example, on Linux
       <filename>/usr/share/zoneinfo</filename> contains the database
       of time zones; the names of the files in that directory can be
       used as parameters to this command.
      </para>

      <para>
       If an invalid time zone is specified, the time zone
       becomes GMT (on most systems anyway).
      </para>
d220 2
a221 5
      <para>
       If the <envar>PGTZ</envar> environment variable is set in the frontend
       environment of a client based on <application>libpq</>, <application>libpq</> will automatically
       <command>SET TIMEZONE</command> to the value of
       <envar>PGTZ</envar> during connection start-up. 
a226 6

  <para>
   Use <xref linkend="SQL-SHOW" endterm="SQL-SHOW-title"> to show the
   current setting of a parameter.
  </para>
  
d231 1
a231 2
  <para>
    
d243 1
a243 2
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable>' is not a
	 valid option name</computeroutput></term>
d252 1
a252 2
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable>':
	 permission denied</computeroutput></term>
d261 1
a261 2
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable>' cannot
	 be changed after server start</computeroutput></term>
a267 1
     
a268 1
  </para>
d276 1
a276 1
   capability. See <xref linkend="functions-misc">.
d282 8
d292 4
a295 4
   <productname>PostgreSQL</productname> with European conventions:
   <screen>
SET DATESTYLE TO PostgreSQL,European;
   </screen>
d300 2
a301 5
   preserve the uppercase spelling of the time zone name (note
   that the date style is <literal>PostgreSQL</literal> for this
   example): 

   <screen>
d303 1
a303 14
SELECT CURRENT_TIMESTAMP AS today;
               today                
------------------------------------
 Tue Feb 26 07:32:21.42834 2002 PST
   </screen>
  </para>

  <para>
   Set the time zone for Italy (note the required single quotes to handle 
   the special characters):

   <screen>
SET TIME ZONE 'Europe/Rome';
SELECT CURRENT_TIMESTAMP AS today;
d305 1
a305 1
             today             
d307 2
a308 2
 2002-10-08 05:39:35.008271+02
   </screen>
d312 1
a312 1
 <refsect1 id="R1-SQL-SET-3">
d315 7
a321 16
  <refsect2 id="R2-SQL-SET-4">
   <title>
    SQL92
   </title>

   <para>
    <literal>SET TIME ZONE</literal>
    extends syntax defined in
    <acronym>SQL9x</acronym>. <acronym>SQL9x</acronym> allows
    only numeric time zone offsets while
    <productname>PostgreSQL</productname> allows full time zone
    specifier strings as well. All other <literal>SET</literal>
    features are
    <productname>PostgreSQL</productname> extensions.
   </para>
  </refsect2>
d327 4
a330 7
  <simpara>
   <xref linkend="SQL-SHOW" endterm="SQL-SHOW-title">,
   <xref linkend="SQL-RESET" endterm="SQL-RESET-title">,
   <xref linkend="sql-set-constraints" endterm="sql-set-constraints-title">,
   <xref linkend="sql-set-session-authorization" endterm="sql-set-session-authorization-title">,
   <xref linkend="sql-set-transaction" endterm="sql-set-transaction-title">
  </simpara>
@


1.73
log
@Merge documentation into one book.  (Build with "make html".)  Replace
vague cross-references with real links.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.72 2003/01/19 00:13:31 momjian Exp $
d55 1
a55 1
        A settable run-time parameter.
d82 3
a84 2
   parameters.  Many of the run-time parameters listed in the
   <xref linkend="runtime-config"> can be changed on-the-fly with <command>SET</command>.
d127 1
a127 1
       settings are involved: the default date/time output and the
d151 1
a151 1
           style), the naming of this option is a historical accident.
a287 11
     <term>SERVER_ENCODING</term>
     <listitem>
      <para>
       Shows the server-side multibyte encoding.  (At present, this
       parameter can be shown but not set, because the encoding is
       determined at <application>initdb</> time.)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
d403 1
a403 1
     <term><computeroutput>ERROR:  '<replaceable>name</replaceable> is not a
d440 1
a440 1
   The function <function>set_config</function> provides the equivalent
d510 2
@


1.72
log
@This patch includes a lot of minor cleanups to the SGML documentation,
including:

- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on

- fix an omission in the EXECUTE documentation

- add some more text to the EXPLAIN documentation

- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)

- minor markup fixes


Neil Conway
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.71 2003/01/12 01:33:00 momjian Exp $
d83 1
a83 1
   &cite-admin; can be changed on-the-fly with <command>SET</command>.
d114 1
a114 1
   <varname>autocommit</> section of the &cite-admin; for details.
d446 8
a523 6

  <para>
    The function <function>set_config</function> provides the equivalent
    capability. See <citetitle>Miscellaneous Functions</citetitle> in
    the &cite-user;.
  </para>
@


1.71
log
@SGML build cleanups from Neil Conway.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.70 2003/01/11 17:03:45 momjian Exp $
d83 5
a87 5
   <citetitle>Administrator's Guide</citetitle> can be changed on-the-fly
   with <command>SET</command>.  (But some require superuser privileges
   to change, and others cannot be changed after server or session start.)
   Note that <command>SET</command> only affects the value used by the
   current session.
d112 1
a112 1
   Even with <literal>autocommit</> set to <literal>off</>, <command>SET</>
d114 1
a114 2
   <literal>autocommit</> section of the <citetitle>Administrator's
   Guide</citetitle> for details.
d519 2
a520 2
    capability. See <citetitle>Miscellaneous Functions</citetitle> in the
    <citetitle>PostgreSQL User's Guide</citetitle>.
@


1.70
log
@Fix markup problem in link to other SGML file.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.69 2003/01/11 00:39:52 momjian Exp $
d513 3
a515 3
   <xref linkend="sql-set-constraints" endterm="sql-set-constraints">,
   <xref linkend="sql-set-session-auth" endterm="sql-set-session-auth">,
   <xref linkend="sql-set-transaction" endterm="sql-set-transaction">
@


1.69
log
@Add doc links from SET to SET_CONSTRAINTS, SET_SESSION_AUTH,
SET_TRANSACTION.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.68 2002/10/13 16:55:05 tgl Exp $
d513 3
a515 3
   <xref linkend="sql-set_constraints" endterm="sql-set_constraints">,
   <xref linkend="sql-set_session_auth" endterm="sql-set-session_auth">,
   <xref linkend="sql-set_transaction" endterm="sql-set_transaction">
@


1.68
log
@Make SET really not start a transaction.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.67 2002/10/09 16:27:48 momjian Exp $
d511 6
@


1.67
log
@set.patch updates an example in ref/set.sgml to have microsecond
precision.

vacuum.patch updates ref/vacuum.sgml to explicitly state that an
exclusive lock is not obtained during normal (non-FULL) vacuum.

  Rod Taylor
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.66 2002/10/09 04:59:38 momjian Exp $
d112 1
a112 1
   With <literal>autocommit</> set to <literal>off</>, <command>SET</>
d114 2
a115 1
   <literal>autocommit</> section of the documentation for details.
@


1.66
log
@Have SET not start transaction when autocommit off, with doc updates.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.65 2002/09/21 18:32:54 petere Exp $
d479 4
a482 4
   
         today
------------------------
 1998-03-31 17:41:31+02
@


1.65
log
@Add more appropriate markup.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.64 2002/08/04 05:09:36 momjian Exp $
d109 6
@


1.64
log
@This patch fixes a probably harmless write of uninitialized memory in
the statistics collector and makes a number of corrections to the
documentation for SET, SHOW, and COPY.

Neil Conway
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.63 2002/08/04 03:53:11 momjian Exp $
d116 1
a116 1
     <term>DATESTYLE</term>
d129 1
a129 1
         <term>ISO</term>
d139 1
a139 1
         <term>SQL</term>
d150 1
a150 1
         <term>PostgreSQL</term>
d159 1
a159 1
         <term>German</term>
d176 1
a176 1
         <term>European</term>
d185 2
a186 2
         <term>NonEuropean</term>
         <term>US</term>
d212 1
a212 1
       There are several now-deprecated means for setting the datestyle
d228 3
a230 3
         If PGDATESTYLE is set in the frontend environment of a client
         based on libpq, libpq will automatically set DATESTYLE to the
         value of PGDATESTYLE during connection start-up.  This is
d286 1
a286 1
       determined at initdb time.)
d376 1
a376 1
       environment of a client based on libpq, libpq will automatically
@


1.63
log
@Here is a doc patch for the SHOW X changes and new config-settings
functions. If there are no objections, please apply.

Joe Conway
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/set.sgml,v 1.62 2002/06/11 15:41:30 thomas Exp $
d407 2
a408 1
     <term><computeroutput>ERROR:  not a valid option name: <replaceable>name</replaceable></computeroutput></term>
d417 2
a418 1
     <term><computeroutput>ERROR:  permission denied</computeroutput></term>
d427 2
a428 1
     <term><computeroutput>ERROR:  <replaceable>name</replaceable> can only be set at start-up</computeroutput></term>
@


1.62
log
@Implement SQL99 OVERLAY(). Allows substitution of a substring in a string.
Implement SQL99 SIMILAR TO as a synonym for our existing operator "~".
Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape).
 Extend the definition to make the FOR clause optional.
 Define textregexsubstr() to actually implement this feature.
Update the regression test to include these new string features.
 All tests pass.
Rename the regular expression support routines from "pg95_xxx" to "pg_xxx".
Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.61 2002/05/18 15:44:47 petere Exp $
d497 10
@


1.61
log
@Revise command completion tags as per hackers message on 20 March.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.60 2002/05/17 01:19:16 tgl Exp $
d31 2
a32 2
	(This is the default if neither <option>SESSION</> nor
	<option>LOCAL</> appears.)
d42 5
a46 5
	transaction.  After <command>COMMIT</> or <command>ROLLBACK</>,
	the session-level setting takes effect again.  Note that
	<command>SET LOCAL</> will appear to have no effect if it's
	executed outside a <command>BEGIN</> block, since the transaction
	will end immediately.
a114 1

d128 38
a165 38
	<varlistentry>
	 <term>ISO</term>
	 <listitem>
	  <para>
	   Use ISO 8601-style dates and times (<literal>YYYY-MM-DD
	   HH:MM:SS</literal>). This is the default.
          </para>
	 </listitem>
	</varlistentry>

        <varlistentry>
	 <term>SQL</term>
	 <listitem>
	  <para>
	   Use Oracle/Ingres-style dates and times. Note that this
	   style has nothing to do with SQL (which mandates ISO 8601
	   style), the naming of this option is a historical accident.
	  </para>
	 </listitem>
	</varlistentry>

        <varlistentry>
	 <term>PostgreSQL</term>
	 <listitem>
	  <para>
	   Use traditional <productname>PostgreSQL</productname> format.
	  </para>
	 </listitem>
	</varlistentry>

        <varlistentry>
	 <term>German</term>
	 <listitem>
	  <para>
	   Use <literal>dd.mm.yyyy</literal> for numeric date representations.
	  </para>
	 </listitem>
	</varlistentry>
d175 18
a192 18
	<varlistentry>
	 <term>European</term>
	 <listitem>
	  <para>
	   Use <literal>dd/mm/yyyy</literal> for numeric date representations.
	  </para>
	 </listitem>
	</varlistentry>

        <varlistentry>
	 <term>NonEuropean</term>
	 <term>US</term>
	 <listitem>
	  <para>
	   Use <literal>mm/dd/yyyy</literal> for numeric date representations.
	  </para>
	 </listitem>
	</varlistentry>
d216 17
a232 17
	<member>
	 Setting the postmaster's <envar>PGDATESTYLE</envar> environment
	 variable.  (This will be overridden by any of the other methods.)
	</member>
	<member>
	 Running postmaster using the option <option>-o -e</option> to
	 select the <literal>European</literal> conventions.
	 (This overrides environment variables and configuration-file
	 entries.)
	</member>
	<member>
	 Setting the client's <envar>PGDATESTYLE</envar> environment variable.
	 If PGDATESTYLE is set in the frontend environment of a client
	 based on libpq, libpq will automatically set DATESTYLE to the
	 value of PGDATESTYLE during connection start-up.  This is
	 equivalent to a manually issued <command>SET</>.
	</member>
d252 1
a252 1
	Sets the internal seed for the random number generator.
d254 14
a267 14
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">value</replaceable></term>
	  <listitem>
	   <para>
	    The value for the seed to be used by the
	    <function>random</function> function. Allowed
	    values are floating-point numbers between 0 and 1, which
	    are then multiplied by 2<superscript>31</>-1.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
d269 3
a271 3
	<para>
	 The seed can also be set by invoking the
	 <function>setseed</function> SQL function:
d273 1
a273 1
	 <programlisting>
d275 4
a278 2
	 </programlisting>
	</para>
d280 10
a289 2
      </listitem>
     </varlistentry>
d291 4
a294 15
     <varlistentry>
      <term>SERVER_ENCODING</term>
      <listitem>
       <para>
	Shows the server-side multibyte encoding.  (At present, this
	parameter can be shown but not set, because the encoding is
	determined at initdb time.)
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>TIME ZONE</term>
      <term>TIMEZONE</term>
      <listitem>
d302 2
a303 8
       <para>
	The available time zone names depend on your operating
	system. For example, on Linux
	<filename>/usr/share/zoneinfo</filename> contains the database
	of time zones.
       </para>
       <para>
	Here are some typical values for time zone names:
d306 54
a359 26
	 <varlistentry>
	  <term>'PST8PDT'</term>
	  <listitem>
	   <para>
	    Set the time zone for California.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>'Portugal'</term>
	  <listitem>
	   <para>
	    Set the time zone for Portugal.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>'Europe/Rome'</term>
	  <listitem>
	   <para>
	    Set the time zone for Italy.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
d361 7
a367 3
       <para>
	In addition to time zone names, <productname>PostgreSQL</productname>
	accepts these other methods of specifying a time zone:
d369 4
a372 42
       <variablelist>
	 <varlistentry>
	  <term>7</term>
	  <listitem>
	   <para>
	    Set the time zone to 7 hours offset west from GMT (equivalent
	   to PDT).
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>INTERVAL '08:00' HOUR TO MINUTE</term>
	  <listitem>
	   <para>
	    Set the time zone to 8 hours offset west from GMT (equivalent
	   to PST).
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>LOCAL</term>
          <term>DEFAULT</term>
	  <listitem>
	   <para>
	    Set the time zone to your local time zone (the one that
	    your operating system defaults to).
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
       <para>
	If an invalid time zone name is specified, the time zone
	becomes GMT (on most systems anyway).
       </para>
       <para>
        If the <envar>PGTZ</envar> environment variable is set in the frontend
	environment of a client based on libpq, libpq will automatically
	set TIMEZONE to the value of <envar>PGTZ</envar> during connection start-up.
       </para>
      </listitem>
     </varlistentry>
d374 10
a383 2
    </variablelist>
   </para>
@


1.60
log
@Merge the last few variable.c configuration variables into the generic
GUC support.  It's now possible to set datestyle, timezone, and
client_encoding from postgresql.conf and per-database or per-user
settings.  Also, implement rollback of SET commands that occur in a
transaction that later fails.  Create a SET LOCAL var = value syntax
that sets the variable only for the duration of the current transaction.
All per previous discussions in pghackers.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.59 2002/04/21 19:02:39 thomas Exp $
d404 1
a404 1
     <term><computeroutput>SET VARIABLE</computeroutput></term>
@


1.59
log
@Augment the date/time examples in the User's Guide to reflect the newer
 capabilities of specifying time zones as intervals per SQL9x.
Put refentrytitle contents on the same line as the tag.
 Otherwise, leading whitespace is propagated into the product, which
 (at least) messes up the ToC layout.
Remove (some) docinfo tags containing dates. Best to omit if the dates
 are not accurate; maybe use CVS dates instead or leave them out.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.58 2002/02/26 15:59:08 tgl Exp $
d17 2
a18 2
SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL | DEFAULT }
d25 26
d59 1
d79 1
d82 31
a112 1
   parameters. The following parameters can be altered:
a114 16
    <varlistentry>
     <term>CLIENT_ENCODING</term>
     <term>NAMES</term>
     <listitem>
      <para>
       Sets the multibyte client encoding. The specified encoding
       must be supported by the backend.
      </para>

      <para>
       This option is only available if
       <productname>PostgreSQL</productname> is build with multibyte
       support.
      </para>
     </listitem>
    </varlistentry>
d121 1
a121 1
       settings are made: the default date/time output and the
d204 12
a215 1
       Date format initialization may be done by:
d218 2
a219 4
	 Setting the <envar>PGDATESTYLE</envar> environment variable.
	 If PGDATESTYLE is set in the frontend environment of a client
	 based on libpq, libpq will automatically set DATESTYLE to the
	 value of PGDATESTYLE during connection start-up.
d223 10
a232 1
	 set dates to the <literal>European</literal> convention.
d237 6
d244 1
a244 6
       <command>SET DATESTYLE</command> affects interpretation of
       input and provides several standard output formats. For
       applications needing different variations or tighter control
       over input or output, consider using
       the <function>to_char</function> family of
       functions.
d263 1
a263 11
	    are then multiplied by 2<superscript>31</>-1. This product will
	    silently overflow if a number outside the range is used.
	   </para>

	   <para>
	    The seed can also be set by invoking the
	    <function>setseed</function> SQL function:

	    <programlisting>
SELECT setseed(<replaceable>value</replaceable>);
	    </programlisting>
d270 9
d286 3
a288 7
	Sets the multibyte server encoding.
       </para>

       <para>
	This option is only available if
	<productname>PostgreSQL</productname> was built with multibyte
	support.
d300 2
a301 2
       constant, or a string representing a time zone supported by
       the host operating system.
d305 1
a305 1
	The possible values for time zone depends on your operating
d311 1
a311 1
	Here are some valid values for time zone:
d338 8
d377 1
a377 1
	If an invalid time zone is specified, the time zone
a391 5
   An extended list of other run-time parameters can be found in the
   <citetitle>Administrator's Guide</citetitle>.
  </para>

  <para>
d393 1
a393 1
   current setting of a parameters.
d425 1
a425 1
       You must be a superuser to have access to certain settings.
d456 1
a456 1
   preserve the uppercase attributes of the time zone specifier (note
d499 2
a500 2
    features are a 
    <productname>PostgreSQL</productname> extension.
@


1.58
log
@Correct typo noticed by Christopher Kings-Lynne.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.57 2002/01/07 02:29:15 petere Exp $
d29 1
a29 1
	A settable run-time parameter.
d37 4
a40 4
	New value of parameter.  <option>DEFAULT</option> can be
	used to specify resetting the parameter to its default
	value. Lists of strings are allowed, but more complex
	constructs may need to be single or double quoted.
d176 1
d178 5
a182 3
       The <option>DateStyle</option> option is really only intended
       for porting applications. To format your date/time values to
       choice, use the <function>to_char</function> family of
d390 1
a390 1
<screen>
d392 2
a393 1
</screen>
d395 2
a396 1
   Set the time zone for Berkeley, California, using double quotes to
d398 2
a399 1
   that the date/time format is ISO here):
d401 1
a401 1
<screen> 
d404 5
a408 5
   
         today
------------------------
 1998-03-31 07:41:21-08
</screen>
d410 2
a411 1
   Set the time zone for Italy (note the required single or double quotes to handle 
d414 1
a414 1
<screen> 
d421 1
a421 1
</screen>
d434 7
a440 4
    The second syntax shown above (<literal>SET TIME ZONE</literal>)
    attempts to mimic <acronym>SQL92</acronym>. However, SQL allows
    only numeric time zone offsets. All other parameter settings as
    well as the first syntax shown above are a
@


1.57
log
@Editorial review
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.56 2001/12/29 20:29:49 momjian Exp $
d396 1
a396 1
SET TIME ZONE "PST8PDT";
@


1.56
log
@Add missing <varlistentry>;  shown in build logs.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.55 2001/12/29 18:35:54 thomas Exp $
d198 2
a199 2
	    values are floating point numbers between 0 and 1, which
	    are then multiplied by 2^31-1. This product will
@


1.55
log
@Document the precision arguments for date/time types per SQL9x.
Update the list of recognized time zones.
Document the range of arguments allowed for SET TIME ZONE.
Still need to add info on other date/time symbols (e.g. "AM", "T")
 and to freshen the docs on the date/time parsing rules.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.54 2001/12/08 03:24:39 thomas Exp $
d288 1
@


1.54
log
@Use PostgreSQL consistantly throughout docs. Before, usage was split evenly
 between Postgres and PostgreSQL.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.53 2001/09/03 12:57:50 petere Exp $
d238 7
d253 2
a254 2
				
	<variablelist>
d256 1
a256 1
	  <term>PST8PDT</term>
d264 1
a264 1
	  <term>Portugal</term>
d267 1
a267 1
	    Set time zone for Portugal.
d275 18
a292 1
	    Set time zone for Italy.
d313 1
a313 1
        If the PGTZ environment variable is set in the frontend
d315 1
a315 1
	set TIMEZONE to the value of PGTZ during connection start-up.
@


1.53
log
@Put some kind of grammatical uniformity in the <refpurpose> lines.
@
text
@d2 2
a3 2
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.52 2001/03/05 19:00:01 petere Exp $
Postgres documentation
d68 1
a68 1
       <productname>Postgres</productname> is build with multibyte
d109 1
a109 1
	 <term>Postgres</term>
d112 1
a112 1
	   Use traditional <productname>Postgres</productname> format.
d130 1
a130 1
       <quote>SQL</quote> and <quote>Postgres</quote> output formats
d228 1
a228 1
	<productname>Postgres</productname> was built with multibyte
d360 2
a361 1
   Set the style of date to traditional Postgres with European conventions:
d363 1
a363 1
SET DATESTYLE TO Postgres,European;
d406 1
a406 1
    <productname>Postgres</productname> extension.
@


1.52
log
@Sorry, that change was not correct.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.51 2001/03/05 18:42:57 momjian Exp $
d13 1
a13 1
  <refpurpose>Set run-time parameters</refpurpose>
@


1.51
log
@I'm attaching those diffs for the Reference Guide in a tar file, as
not all of them attached properly in the post I made a few minutes
ago. Please disregard those earlier files. The diffs in the tar file
replace them.

Pierce Tyler
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.50 2000/10/05 19:48:19 momjian Exp $
d199 1
a199 1
	    are then multiplied by RAND_MAX. This product will
@


1.50
log
@Add proofreader's changes to docs.
Fix misspelling of disbursion to dispersion.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.49 2000/09/12 21:12:45 momjian Exp $
d199 1
a199 1
	    are then multiplied by 2^31-1. This product will
@


1.49
log
@typo fix
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.48 2000/08/29 20:02:09 momjian Exp $
d239 1
a239 1
	The possible values for timezone depends on your operating
d245 1
a245 1
	Here are some valid values for timezone:
d365 1
a365 1
   Set the timezone for Berkeley, California, using double quotes to
d378 1
a378 1
   Set the timezone for Italy (note the required single or double quotes to handle 
@


1.48
log
@Startup is actually start-up.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.47 2000/08/07 00:51:18 tgl Exp $
d62 1
a62 1
       Sets the multi-byte client encoding. The specified encoding
d223 1
a223 1
	Sets the multi-byte server encoding.
@


1.47
log
@Clean up bogosities in use of random(3) and srandom(3) --- do not assume
that RAND_MAX applies to them, since it doesn't.  Instead add a
config.h parameter MAX_RANDOM_VALUE.  This is currently set at 2^31-1
but could be auto-configured if that ever proves necessary.  Also fix
some outright bugs like calling srand() where srandom() is appropriate.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.46 2000/07/14 15:27:14 thomas Exp $
d168 1
a168 1
	 value of PGDATESTYLE during connection startup.
d291 1
a291 1
	set TIMEZONE to the value of PGTZ during connection startup.
d344 1
a344 1
     <term><computeroutput>ERROR:  <replaceable>name</replaceable> can only be set at startup</computeroutput></term>
@


1.46
log
@Add information on SET SESSION CHARACTERISTICS.
Fix references to pg_hba.conf(5) since that is no longer a man page.
Make minor repairs to "Compatibility" subsections.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.45 2000/06/18 21:24:52 petere Exp $
d197 1
a197 1
	    <function>random</function> catalog function. Significant
d199 1
a199 1
	    are then multiplied by RAND_MAX. This product will
@


1.45
log
@Separated set constraints and set transaction reference pages, revised set
reference page to new configuration system. Big update to administrator's
guide, chapters Runtime environment, Client authentication, and User
management, the latter two were part of the old Security chapter.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.43 2000/05/18 14:24:33 momjian Exp $
d395 13
a407 7
  <para>
   The second syntax shown above (<literal>SET TIME ZONE</literal>)
   attempts to mimic <acronym>SQL92</acronym>. However, SQL allows
   only numeric time zone offsets. All other parameter settings as
   well as the first syntax shown above are a
   <productname>Postgres</productname> extension.
  </para>
@


1.44
log
@Inheritance overhaul by  Chris Bitmead <chris@@bitmead.com>
@
text
@a1 3
<<<<<<< set.sgml
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.42 2000/04/18 15:23:34 thomas Exp $
=======
a2 1
>>>>>>> 1.43
d8 1
a8 3
  <refentrytitle id="SQL-SET-TITLE">
   SET
  </refentrytitle>
d12 2
a13 6
  <refname>
   SET
  </refname>
  <refpurpose>
   Set run-time parameters for session
  </refpurpose>
a15 3
  <refsynopsisdivinfo>
   <date>1999-07-20</date>
  </refsynopsisdivinfo>
a17 1
SET CONSTRAINTS {ALL | <replaceable class="parameter">constraintlist</replaceable>} <replaceable>mode</replaceable>
a18 1
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE }
d22 1
a22 6
   <refsect2info>
    <date>1998-09-24</date>
   </refsect2info>
   <title>
    Inputs
   </title>
a23 1
		
d29 1
a29 1
	Settable global parameter.
d46 1
d48 7
a54 533
   <para>
    The possible variables and allowed values are:
		
    <variablelist>
     <varlistentry>
      <term>CLIENT_ENCODING | NAMES</term>
      <listitem>
       <para>
	Sets the multi-byte client encoding. Parameters are:
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">value</replaceable></term>
	  <listitem>
	   <para>
	    Sets the multi-byte client encoding to
	    <replaceable class="parameter">value</replaceable>.
	    The specified encoding must be supported by the backend.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>

       <para>
	This option is only available if MULTIBYTE support was enabled
	during the configure step of building Postgres.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>DATESTYLE</term>
      <listitem>
       <para>
	Set the date/time representation style. Affects the output format,
	and in some cases it can affect the interpretation of input.

	<variablelist>
	 <varlistentry>
	  <term>ISO</term>
	  <listitem>
	   <para>
	    use ISO 8601-style dates and times
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>SQL</term>
	  <listitem>
	   <para>
	    use Oracle/Ingres-style dates and times
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>Postgres</term>
	  <listitem>
	   <para>
	    use traditional <productname>Postgres</productname> format
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>European</term>
	  <listitem>
	   <para>
	    use <literal>dd/mm/yyyy</literal> for numeric date representations.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>NonEuropean</term>
	  <listitem>
	   <para>
	    use <literal>mm/dd/yyyy</literal> for numeric date representations.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>German</term>
	  <listitem>
	   <para>
	    use <literal>dd.mm.yyyy</literal> for numeric date representations.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>US</term>
	  <listitem>
	   <para>
	    same as <literal>NonEuropean</literal>
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>DEFAULT</term>
	  <listitem>
	   <para>
	    restores the default values (<literal>ISO</literal>)
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>

       <para>
	Date format initialization may be done by:
	<simplelist>
	 <member>
	  Setting the <envar>PGDATESTYLE</envar> environment variable.
	  If PGDATESTYLE is set in the frontend environment of a client
	  based on libpq, libpq will automatically set DATESTYLE to the
	  value of PGDATESTYLE during connection startup.
	 </member>
	 <member>
	  Running postmaster using the option <option>-o -e</option> to set
	  dates to the <literal>European</literal> convention.
	  Note that this affects only some combinations of date styles; for example
	  the ISO style is not affected by this parameter.
	 </member>
	 <member>
	  Changing variables in 
	  <filename>src/backend/utils/init/globals.c</filename>.
	 </member>
	</simplelist>
       </para>
       <para>
	The variables in <filename>globals.c</filename> which can be changed are:
	<simplelist>
	 <member>
	  bool EuroDates = false | true
	 </member>
	 <member>
	  int  DateStyle = USE_ISO_DATES | USE_POSTGRES_DATES | USE_SQL_DATES | USE_GERMAN_DATES
	 </member>
	</simplelist>
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>SEED</term>
      <listitem>
       <para>
	Sets the internal seed for the random number generator.
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">value</replaceable></term>
	  <listitem>
	   <para>
	    The value for the seed to be used by the
	    <function>random</function> catalog function. Significant
	    values are floating point numbers between 0 and 1, which
	    are then multiplied by RAND_MAX. This product will
	    silently overflow if a number outside the range is used.
	   </para>

	   <para>
	    The seed can also be set by invoking the
	    <function>setseed</function> SQL function:

	    <programlisting>
SELECT setseed(<replaceable>value</replaceable>);
	    </programlisting>
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>

       <para>
	This option is only available if MULTIBYTE support was enabled
	during the configure step of building Postgres.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>SERVER_ENCODING</term>
      <listitem>
       <para>
	Sets the multi-byte server encoding to:
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">value</replaceable></term>
	  <listitem>
	   <para>
	    The identifying value for the server encoding.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>

       <para>
	This option is only available if MULTIBYTE support was enabled
	during the configure step of building Postgres.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>CONSTRAINTS</term>
      <listitem>
       <para>
	SET CONSTRAINTS affects the behavior of constraint evaluation
	in the current transaction.
	SET CONSTRAINTS, specified
	in SQL3, has these allowed parameters:

	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">constraintlist</replaceable></term>
	  <listitem>
	   <para>
	    Comma separated list of deferrable constraint names.
	   </para>
	  </listitem>
	 </varlistentry>

	 <varlistentry>
	  <term><replaceable class="parameter">mode</replaceable></term>
	  <listitem>
	   <para>
	    The constraint mode. Allowed values are
	    <option>DEFERRED</option> and <option>IMMEDIATE</option>.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>

       <para>
	In <option>IMMEDIATE</option> mode, foreign key constraints
	are checked at the end of each query.
       </para>

       <para>
	In <option>DEFERRED</option> mode, foreign key constraints
	marked as <option>DEFERRABLE</option> are checked only at
	transaction commit or  until its mode is explicitly set to 
	<option>IMMEDIATE</option>.
	This is actually only done for foreign  key
	constraints,  so  it  does  not  apply  to  UNIQUE  or  other
	constraints.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>TIME ZONE</term>
      <term>TIMEZONE</term>
      <listitem>
       <para>
	The possible values for timezone depends on your operating
	system. For example on Linux /usr/lib/zoneinfo contains the
	database of timezones.
       </para>
       <para>
	Here are some valid values for timezone:
				
	<variablelist>
	 <varlistentry>
	  <term>PST8PDT</term>
	  <listitem>
	   <para>
	    set the timezone for California
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>Portugal</term>
	  <listitem>
	   <para>
	    set time zone for Portugal.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>'Europe/Rome'</term>
	  <listitem>
	   <para>
	    set time zone for Italy.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>DEFAULT</term>
	  <listitem>
	   <para>
	    set time zone to your local timezone
	    (value of the TZ environment variable).
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
       <para>
	If an invalid time zone is specified, the time zone
	becomes GMT (on most systems anyway).
       </para>
       <para>
	The second syntax shown above, allows one to set the timezone
	with a syntax similar to SQL92 <command>SET TIME ZONE</command>.
	The LOCAL keyword is just an alternate form
	of DEFAULT for SQL92 compatibility.
       </para>
       <para>
        If the PGTZ environment variable is set in the frontend
	environment of a client based on libpq, libpq will automatically
	set TIMEZONE to the value of PGTZ during connection startup.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>TRANSACTION ISOLATION LEVEL</term>
      <listitem>
       <para>
	Sets the isolation level for the current transaction.
	
	<variablelist>
	 <varlistentry>
	  <term>READ COMMITTED</term>
	  <listitem>
	   <para>
	    The current transaction queries read only rows committed
	    before a query began. READ COMMITTED is the default.
	   </para>

	   <note>
	   <para>
	    <acronym>SQL92</acronym> standard requires 
	    SERIALIZABLE to be the default isolation level.
	   </para>
	   </note>
	  </listitem>
	 </varlistentry>
	 
	 <varlistentry>
	  <term>SERIALIZABLE</term>
	  <listitem>
	   <para>
	    The current transaction queries read only rows committed
	    before first DML statement 
	    (<command>SELECT/INSERT/DELETE/UPDATE/FETCH/COPY_TO</command>)
	    was executed in this transaction. 
	   </para>
	  </listitem>
	 </varlistentry>
	 
	</variablelist>
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>

   <para>
    There are also several internal or optimization
    parameters which can be specified
    by the <command>SET</command> command:
    
    <variablelist>
     <varlistentry>
      <term>PG_OPTIONS</term>
      <listitem>
       <para>
        Sets various backend parameters.
       </para>
      </listitem>
     </varlistentry>
    
     <varlistentry>
      <term>RANDOM_PAGE_COST</term>
      <listitem>
       <para>
        Sets the optimizer's estimate of the cost of a nonsequentially
	fetched disk page.  This is measured as a multiple of the cost
	of a sequential page fetch.
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">float8</replaceable></term>
	  <listitem>
	   <para>
	    Set the cost of a random page access
	    to the specified floating-point value.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>
    
     <varlistentry>
      <term>CPU_TUPLE_COST</term>
      <listitem>
       <para>
        Sets the optimizer's estimate of the cost of processing each
	tuple during a query.  This is measured as a fraction of the cost
	of a sequential page fetch.
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">float8</replaceable></term>
	  <listitem>
	   <para>
	    Set the cost of per-tuple CPU processing
	    to the specified floating-point value.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>
    
     <varlistentry>
      <term>CPU_INDEX_TUPLE_COST</term>
      <listitem>
       <para>
        Sets the optimizer's estimate of the cost of processing each
	index tuple during an index scan.  This is measured as a fraction
	of the cost of a sequential page fetch.
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">float8</replaceable></term>
	  <listitem>
	   <para>
	    Set the cost of per-index-tuple CPU processing
	    to the specified floating-point value.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>
    
     <varlistentry>
      <term>CPU_OPERATOR_COST</term>
      <listitem>
       <para>
        Sets the optimizer's estimate of the cost of processing each
	operator in a WHERE clause.  This is measured as a fraction
	of the cost of a sequential page fetch.
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">float8</replaceable></term>
	  <listitem>
	   <para>
	    Set the cost of per-operator CPU processing
	    to the specified floating-point value.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>
    
     <varlistentry>
      <term>EFFECTIVE_CACHE_SIZE</term>
      <listitem>
       <para>
        Sets the optimizer's assumption about the effective size of the
	disk cache (that is, the portion of the kernel's disk cache that
	will be used for Postgres data files).  This is measured in disk
	pages, which are normally 8Kb apiece.
	
	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">float8</replaceable></term>
	  <listitem>
	   <para>
	    Set the assumed cache size
	    to the specified floating-point value.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>EXAMINE_SUBCLASS</term>
      <listitem>
       <para>
       Changes the behaviour of SELECT so that it no longer automatically
       examines sub-classes. (See SELECT). By default a SELECT on a table
       will also return subclass tuples unless specifying ONLY tablename.
       Setting this returns postgres to the traditional behaviour of
       only returning subclasses when appending "*" to the tablename.
	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
       Returns SELECT to the behaviour of automatically returning
       results from sub-classes.
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
       Prevents SELECT from returning sub-classes unless the "*" follows the table name
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>ENABLE_SEQSCAN</term>
      <listitem>
       <para>
        Enables or disables the planner's use of sequential scan plan types.
	(It's not possible to suppress sequential scans entirely, but turning
	this variable OFF discourages the planner from using one if there is
	any other method available.)
d56 128
a183 22
	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables use of sequential scans (default setting).
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
	    disables use of sequential scans.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>
d186 1
a186 1
      <term>ENABLE_INDEXSCAN</term>
d189 2
a190 2
        Enables or disables the planner's use of index scan plan types.

d193 1
a193 1
	  <term>ON</term>
d196 5
a200 1
	    enables use of index scans (default setting).
d202 1
a202 6
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
d204 6
a209 1
	    disables use of index scans.
a214 8
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>ENABLE_TIDSCAN</term>
      <listitem>
       <para>
        Enables or disables the planner's use of TID scan plan types.
a215 20
	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables use of TID scans (default setting).
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
	    disables use of TID scans.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
d220 1
a220 1
      <term>ENABLE_SORT</term>
d223 1
a223 24
        Enables or disables the planner's use of explicit sort steps.
	(It's not possible to suppress explicit sorts entirely, but turning
	this variable OFF discourages the planner from using one if there is
	any other method available.)

	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables use of sorts (default setting).
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
	    disables use of sorts.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
a224 2
      </listitem>
     </varlistentry>
a225 3
     <varlistentry>
      <term>ENABLE_NESTLOOP</term>
      <listitem>
d227 3
a229 24
        Enables or disables the planner's use of nested-loop join plans.
	(It's not possible to suppress nested-loop joins entirely, but turning
	this variable OFF discourages the planner from using one if there is
	any other method available.)

	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables use of nested-loop joins (default setting).
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
	    disables use of nested-loop joins.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
d235 2
a236 1
      <term>ENABLE_MERGEJOIN</term>
d239 4
a242 21
        Enables or disables the planner's use of mergejoin plans.

	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables use of merge joins (default setting).
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
	    disables use of merge joins.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
a243 6
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>ENABLE_HASHJOIN</term>
      <listitem>
d245 2
a246 2
        Enables or disables the planner's use of hashjoin plans.

d249 1
a249 1
	  <term>ON</term>
d252 1
a252 1
	    enables use of hash joins (default setting).
a255 1
	
d257 1
a257 1
	  <term>OFF</term>
d260 1
a260 1
	    disables use of hash joins.
a263 12
	</variablelist>
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>GEQO</term>
      <listitem>
       <para>
	Sets the threshold for using the genetic optimizer algorithm.

	<variablelist>
d265 1
a265 12
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables the genetic optimizer algorithm
	    for statements with 11 or more tables.
	    (This is also the DEFAULT setting.)
	   </para>
	  </listitem>
	 </varlistentry>

	 <varlistentry>
	  <term>ON=<replaceable class="parameter">#</replaceable></term>
d268 1
a268 3
	    Takes an integer argument to enable the genetic optimizer algorithm
	    for statements with <replaceable class="parameter">#</replaceable>
	    or more tables in the query.
a271 1

d273 2
a274 1
	  <term>OFF</term>
d277 2
a278 1
	    disables the genetic optimizer algorithm.
a283 1

d285 2
a286 2
	See the chapter on GEQO in the Programmer's Guide
	for more information about query optimization.
d289 1
a289 1
        If the PGGEQO environment variable is set in the frontend
d291 1
a291 76
	set GEQO to the value of PGGEQO during connection startup.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>KSQO</term>
      <listitem>
       <para>
	<firstterm>Key Set Query Optimizer</firstterm> causes the query
	planner to convert queries whose WHERE clause contains many
	OR'ed AND clauses (such as "WHERE (a=1 AND b=2) OR (a=2 AND b=3) ...")
	into a UNION query.  This method can be faster than the default
	implementation, but it doesn't necessarily give exactly the same
	results, since UNION implicitly adds a SELECT DISTINCT clause to
	eliminate identical output rows.  KSQO is commonly used when
	working with products like <productname>MicroSoft
	Access</productname>, which tend to generate queries of this form.

	<variablelist>
	 <varlistentry>
	  <term>ON</term>
	  <listitem>
	   <para>
	    enables this optimization.
	   </para>
	  </listitem>
	 </varlistentry>
	
	 <varlistentry>
	  <term>OFF</term>
	  <listitem>
	   <para>
	    disables this optimization (default setting).
	   </para>
	  </listitem>
	 </varlistentry>
	 
	 <varlistentry>
	  <term>DEFAULT</term>
	  <listitem>
	   <para>
	    Equivalent to specifying <command>SET KSQO=OFF</command>.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>

       <para>
        The KSQO algorithm used to be absolutely essential for queries
	with many OR'ed AND clauses, but in Postgres 7.0 and later
	the standard planner handles these queries fairly successfully.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term>MAX_EXPR_DEPTH</term>
      <listitem>
       <para>
        Sets the maximum expression nesting depth that the parser will
	accept.  The default value is high enough for any normal query,
	but you can raise it if you need to.  (But if you raise it too high,
	you run the risk of backend crashes due to stack overflow.)

	<variablelist>
	 <varlistentry>
	  <term><replaceable class="parameter">integer</replaceable></term>
	  <listitem>
	   <para>
	    Maximum depth.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
a297 1
  </refsect2>
a298 44
  <refsect2 id="R2-SQL-SET-2">
   <refsect2info>
    <date>1998-09-24</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>
    
    <variablelist>
     <varlistentry>
      <term><computeroutput>
SET VARIABLE
       </computeroutput></term>
      <listitem>
       <para>
	Message returned if successful.
       </para>
      </listitem>
     </varlistentry>
     
     <varlistentry>
      <term><computeroutput>
NOTICE:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)
       </computeroutput></term>
      <listitem>
       <para>
	If the command fails to set the specified variable.
       </para>
      </listitem>
     </varlistentry>
     
    </variablelist>
   </para>
  </refsect2>
 </refsynopsisdiv>
 
 <refsect1 id="R1-SQL-SET-1">
  <refsect1info>
   <date>1998-09-24</date>
  </refsect1info>
  <title>
   Description
  </title>
d300 2
a301 2
   <command>SET</command> will modify configuration parameters for variable during
   a session.
d303 1
d305 2
a306 5
   Current values can be obtained using <command>SHOW</command>, and values
   can be restored to the defaults using <command>RESET</command>.
   Parameters and values are case-insensitive. Note that the value
   field is always specified as a string, so is enclosed in
   single-quotes.
d308 5
d314 39
a352 6
   <command>SET TIME ZONE</command> changes the session's
   default time zone offset.
   An SQL-session always begins with an initial default time zone
   offset.
   The <command>SET TIME ZONE</command> statement is used to change the default
   time zone offset for the current SQL session.
a353 17
  
  <refsect2 id="R2-SQL-SET-3">
   <refsect2info>
    <date>1998-09-24</date>
   </refsect2info>
   <title>
    Notes
   </title>
   <para>
    The <command>SET <replaceable class="parameter">variable</replaceable></command>
    statement is a <productname>Postgres</productname> language extension.
   </para>
   <para>
    Refer to <command>SHOW</command> and <command>RESET</command> to 
    display or reset the current values.
   </para>
  </refsect2>
d355 1
d357 2
a358 4
 <refsect1 id="R1-SQL-SET-2">
  <title>
   Usage
  </title>
d360 4
a363 18
   Set the style of date to ISO (no quotes on the argument is required):

   <programlisting>
SET DATESTYLE TO ISO;
   </programlisting>

   Enable GEQO for queries with 4 or more tables (note the use of
   single quotes to handle the equal sign inside the value argument):

   <programlisting> 
SET GEQO = 'ON=4';
   </programlisting>

   Set GEQO to default:

   <programlisting> 
SET GEQO = DEFAULT;
   </programlisting>
d366 2
a367 2
   preserve the uppercase
   attributes of the time zone specifier:
d369 1
a369 1
<programlisting> 
d376 1
a376 1
</programlisting>
d381 1
a381 1
<programlisting> 
d388 1
a388 1
</programlisting>
d393 9
a401 26
  <title>
   Compatibility
  </title>
  
  <refsect2 id="R2-SQL-SET-4">
   <refsect2info>
    <date>1998-09-24</date>
   </refsect2info>
   <title>
    SQL92
   </title>
   <para>
    There is no general
    <command>SET <replaceable class="parameter">variable</replaceable></command>
    in <acronym>SQL92</acronym> (with the exception of
    <command>SET TRANSACTION ISOLATION LEVEL</command>).

    The <acronym>SQL92</acronym> syntax for <command>SET TIME ZONE</command>
    is slightly different,
    allowing only a single integer value for time zone specification:
    
    <synopsis>
SET TIME ZONE { interval_value_expression | LOCAL }
    </synopsis>
   </para>
  </refsect2>
@


1.43
log
@Fix WARN->NOTICE in docs.  Change libpgeasy connection parameters to use
PQconnectdb() style connections.
@
text
@d2 1
d4 3
d552 33
@


1.42
log
@Clean up description of SET CONSTRAINTS.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.41 2000/04/14 23:12:29 momjian Exp $
d922 1
a922 1
WARN:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)
@


1.41
log
@Update set constraints man page
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.40 2000/04/14 15:17:28 thomas Exp $
d269 1
a269 1
      <term>CONSTRAINT</term>
d272 5
a276 3
	SET CONSTRAINTS controls the frequency of foreign key
	constratint checking in the current transaction. Allowed
	parameters are:
d300 5
d307 5
a311 3
	transaction commit.
	In <option>IMMEDIATE</option> mode, foreign key constraints
	are checked at the end of each query.
@


1.40
log
@Add mention of SET CONSTRAINT and CREATE CONSTRAINT TRIGGER.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.39 2000/04/11 17:23:35 momjian Exp $
d272 3
a274 4
	SET CONSTRAINTS is the SQL3 specified command to  change  the
	default behaviour of constraints with respect to deferring in the current
	transaction. Allowed parameters are:

d298 5
a302 5
	In deferred mode, the actual check of the constraint is  held
	back  until  either its mode is explicitly set to <option>IMMEDIATE</option>,
	or until COMMIT.  This is actually only done for foreign  key
	constraints,  so  it  does  not  apply  to  UNIQUE  or  other
	constraints.
@


1.39
log
@Uppercase pg_options param
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.38 2000/04/11 03:49:04 momjian Exp $
d27 1
d96 1
a96 1
      <term>DateStyle</term>
d206 1
a206 1
      <term>Seed</term>
d247 1
a247 1
	Sets the multi-byte server encoding
d254 1
a254 1
	    Sets the multi-byte server encoding.
d269 41
d907 1
a907 1
	Message returned if successfully.
@


1.38
log
@Update SET manual pages for pg_options.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.37 2000/04/08 23:12:01 momjian Exp $
d382 1
a382 1
      <term>pg_options</term>
@


1.37
log
@Document FSYNC in pg_options sgml file.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.36 2000/04/07 13:31:18 thomas Exp $
d381 9
@


1.36
log
@Document new SET SEED command.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.35 2000/03/31 17:45:32 tgl Exp $
d162 1
a162 1
	    restores the default values (<literal>US,Postgres</literal>)
@


1.35
log
@Correct typo.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.34 2000/03/31 03:20:17 thomas Exp $
d200 38
@


1.34
log
@Document recent changes in syntax, including examples.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.33 2000/03/26 18:32:27 petere Exp $
a786 1
	  <term>ON</term>
@


1.33
log
@Updated user's guide to match new psql's output format
Fixed bug in createdb/alternative location
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.32 2000/03/17 05:29:03 tgl Exp $
d26 1
a26 1
SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } { '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
d54 3
a56 1
	used to specify resetting the parameter to its default value.
d130 1
a130 1
	    use dd/mm/yyyy for numeric date representations.
d138 1
a138 1
	    use mm/dd/yyyy for numeric date representations.
d146 1
a146 1
	    use dd.mm.yyyy for numeric date representations.
d154 1
a154 1
	    same as 'NonEuropean'
d162 1
a162 1
	    restores the default values ('US,Postgres')
d242 1
a242 1
	  <term>'PST8PDT'</term>
d250 1
a250 1
	  <term>'Portugal'</term>
d760 1
a760 1
	    Equivalent to specifying <command>SET KSQO='OFF'</command>.
d890 2
a891 2
   Set the style of date to ISO:
   
d893 1
a893 1
SET DATESTYLE TO 'ISO';
d896 2
a897 1
   Enable GEQO for queries with 4 or more tables:
d909 3
a911 1
   Set the timezone for Berkeley, California:
d914 1
a914 1
SET TIME ZONE 'PST8PDT';
d922 2
a923 1
Set the timezone for Italy:
d968 1
a968 1
mode: sgml
d978 1
a978 1
sgml-local-catalogs:"/usr/lib/sgml/catalog"
@


1.32
log
@Add safety check on expression nesting depth.  Default value is set by
a config.h #define, and the runtime value can be controlled via SET.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.31 2000/02/27 21:07:03 tgl Exp $
d908 1
a908 1
   <programlisting> 
d912 4
a915 4
   today
   ----------------------
   1998-03-31 07:41:21-08
   </programlisting>
d917 1
a917 1
   Set the timezone for Italy:
d919 1
a919 1
   <programlisting> 
d923 4
a926 4
   today
   ----------------------
   1998-03-31 17:41:31+02
   </programlisting>
@


1.31
log
@Correct bogus syntax in SET example.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.30 2000/02/19 08:14:54 thomas Exp $
d769 24
@


1.30
log
@Clean up markup so docs will compile.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.29 2000/02/15 20:49:07 tgl Exp $
d873 1
a873 1
SET GEQO ON=4;
@


1.29
log
@New cost model for planning, incorporating a penalty for random page
accesses versus sequential accesses, a (very crude) estimate of the
effects of caching on random page accesses, and cost to evaluate WHERE-
clause expressions.  Export critical parameters for this model as SET
variables.  Also, create SET variables for the planner's enable flags
(enable_seqscan, enable_indexscan, etc) so that these can be controlled
more conveniently than via PGOPTIONS.

Planner now estimates both startup cost (cost before retrieving
first tuple) and total cost of each path, so it can optimize queries
with LIMIT on a reasonable basis by interpolating between these costs.
Same facility is a win for EXISTS(...) subqueries and some other cases.

Redesign pathkey representation to achieve a major speedup in planning
(I saw as much as 5X on a 10-way join); also minor changes in planner
to reduce memory consumption by recycling discarded Path nodes and
not constructing unnecessary lists.

Minor cleanups to display more-plausible costs in some cases in
EXPLAIN output.

Initdb forced by change in interface to index cost estimation
functions.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.28 1999/07/22 15:09:15 thomas Exp $
d53 2
a54 2
	New value of parameter.  The word <term>DEFAULT</term> can be
	written to specify resetting the parameter to its default value.
@


1.28
log
@Complete merge of all old man page information.
ecpg reference page still needs formatting.
@
text
@d2 1
a2 1
$Header$
d53 2
a54 1
	New value of parameter.
a81 9
	 
	 <varlistentry>
	  <term>DEFAULT</term>
	  <listitem>
	   <para>
	    Sets the multi-byte client encoding to the default value.
	   </para>
	  </listitem>
	 </varlistentry>
d86 2
a87 1
	This is only enabled if multi-byte was specified to configure.
d172 3
a216 9
	 
	 <varlistentry>
	  <term>DEFAULT</term>
	  <listitem>
	   <para>
	    Sets the multi-byte server encoding.
	   </para>
	  </listitem>
	 </varlistentry>
d219 1
d221 2
a222 1
	This is only enabled if multi-byte was specified to configure.
a278 4
	A frontend which uses libpq may be initialized by setting the PGTZ
	environment variable.
       </para>
       <para>
d284 5
d342 24
a365 1
      <term>COST_HEAP</term>
d368 3
a370 1
	Sets the default cost of a heap scan for use by the optimizer.
d374 1
a374 1
	  <term><replaceable class="parameter">float4</replaceable></term>
d377 2
a378 1
	    Set the cost of a heap scan to the specified floating point value.
d382 184
a565 1
	 
d567 1
a567 1
	  <term>DEFAULT</term>
d570 1
a570 1
	    Sets the cost of a heap scan to the default value.
d576 6
d583 24
a606 2
	The frontend may be initialized by setting the PGCOSTHEAP
	environment variable.
d612 1
a612 1
      <term>COST_INDEX</term>
d615 1
a615 1
	Sets the default cost of an index scan for use by the optimizer.
d617 1
a617 1
	<variablelist>     
d619 1
a619 1
	  <term><replaceable class="parameter">float4</replaceable></term>
d622 1
a622 1
	    Set the cost of an index scan to the specified floating point value.
d626 1
a626 1
	 
d628 1
a628 1
	  <term>DEFAULT</term>
d631 1
a631 1
	    Sets the cost of an index scan to the default value.
d637 2
d640 3
d644 21
a664 2
	The frontend may be initialized by setting the PGCOSTINDEX
	environment variable.
d681 2
a682 1
	    for statements with 6 or more tables.
a705 8
	 <varlistentry>
	  <term>DEFAULT</term>
	  <listitem>
	   <para>
	    Equivalent to specifying <command>SET GEQO='ON'</command>
	   </para>
	  </listitem>
	 </varlistentry>
d710 2
a711 8
	This algorithm is on by default, which used GEQO for
	statements of eleven or more tables.
	(See the chapter on GEQO in the Programmer's Guide
	for more information).
       </para>
       <para>
	The frontend may be initialized by setting PGGEQO
	environment variable.
d714 3
a716 3
	It may be useful when joining big relations with
	small ones. This algorithm is off by default.
	It's not used by GEQO anyway.
d725 10
a734 4
	<firstterm>Key Set Query Optimizer</firstterm> forces the query optimizer
	to optimize repetative OR clauses such as generated by
	<productname>MicroSoft Access</productname>:
       
d749 1
a749 1
	    disables this optimization.
d766 3
a768 7
	It may be useful when joining big relations with
	small ones. This algorithm is off by default.
	It's not used by GEQO anyway.
       </para>
       <para>
	The frontend may be initialized by setting the PGKSQO
	environment variable.
@


1.27
log
@Complete markup for docbook2man support.
Fix synopsis info thanks to Yves.Martin@@ensimag.imag.fr.
@
text
@d1 5
d8 1
a8 1
  <refentrytitle>
d14 1
a14 1
  <refname id="SQL-SET-TITLE">
d23 1
a23 1
   <date>1998-09-24</date>
a669 2
  <para>
  </para>
@


1.26
log
@Complete first pass at markup adjustments for docbook2man man pages.
Add some internal cross references to select.sgml.
@
text
@d23 1
a23 1
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZED }
d37 1
a37 3
      <term>
<replaceable class="PARAMETER">variable</replaceable>
      </term>
d45 1
a45 3
      <term>
<replaceable class="PARAMETER">value</replaceable>
      </term>
d60 1
a60 3
      <term>
CLIENT_ENCODING | NAMES
      </term>
d67 1
a67 3
	  <term>
<replaceable class="parameter">value</replaceable>
	  </term>
d78 1
a78 3
	  <term>
DEFAULT
	  </term>
d95 1
a95 3
      <term>
DateStyle
      </term>
d103 1
a103 3
	  <term>
ISO
	  </term>
d111 1
a111 3
	  <term>
SQL
	  </term>
d119 1
a119 3
	  <term>
Postgres
	  </term>
d127 1
a127 3
	  <term>
European
	  </term>
d135 1
a135 3
	  <term>
NonEuropean
	  </term>
d143 1
a143 3
	  <term>
German
	  </term>
d151 1
a151 3
	  <term>
US
	  </term>
d159 1
a159 3
	  <term>
default
	  </term>
d202 1
a202 3
      <term>
SERVER_ENCODING
      </term>
d209 1
a209 3
	  <term>
<replaceable class="parameter">value</replaceable>
	  </term>
d218 1
a218 3
	  <term>
DEFAULT
	  </term>
d234 1
a234 3
      <term>
TIMEZONE
      </term>
d246 1
a246 3
	  <term>
'PST8PDT'
	  </term>
d254 1
a254 3
	  <term>
'Portugal'
	  </term>
d262 1
a262 3
	  <term>
'Europe/Rome'
	  </term>
d270 1
a270 3
	  <term>
DEFAULT
	  </term>
d298 1
a298 3
      <term>
TRANSACTION ISOLATION LEVEL
      </term>
d305 1
a305 3
	  <term>
READ COMMITTED
	  </term>
d322 1
a322 3
	  <term>
SERIALIZABLE
	  </term>
d347 1
a347 3
      <term>
COST_HEAP
      </term>
d354 1
a354 3
	  <term>
<replaceable class="parameter">float4</replaceable>
	  </term>
d363 1
a363 3
	  <term>
DEFAULT
	  </term>
d380 1
a380 3
      <term>
COST_INDEX
      </term>
d387 1
a387 3
	  <term>
<replaceable class="parameter">float4</replaceable>
	  </term>
d396 1
a396 3
	  <term>
DEFAULT
	  </term>
d414 1
a414 3
      <term>
GEQO
      </term>
d418 1
a418 1
       
d421 1
a421 3
	  <term>
ON
	  </term>
d429 1
d431 1
a431 3
	  <term>
ON=<replaceable class="parameter">#</replaceable>
	  </term>
d440 1
d442 1
a442 3
	  <term>
OFF
	  </term>
d450 1
a450 3
	  <term>
DEFAULT
	  </term>
d479 1
a479 3
      <term>
KSQO
      </term>
d488 1
a488 3
	  <term>
ON
	  </term>
d497 1
a497 3
	  <term>
OFF
	  </term>
d506 1
a506 3
	  <term>
DEFAULT
	  </term>
d543 3
a545 3
      <term>
<returnvalue>SET VARIABLE</returnvalue>
      </term>
d554 3
a556 3
      <term>
<returnvalue>WARN:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue>
      </term>
d622 1
a622 1
   SET DATESTYLE TO 'ISO';
d628 1
a628 1
   SET GEQO ON=4;
d634 1
a634 1
   SET GEQO = DEFAULT;
d640 2
a641 2
   SET TIME ZONE 'PST8PDT';
   SELECT CURRENT_TIMESTAMP AS today;
d651 2
a652 2
   SET TIME ZONE 'Europe/Rome';
   SELECT CURRENT_TIMESTAMP AS today;
d676 1
a676 1
    There is no
d678 3
a680 2
    in <acronym>SQL92</acronym> (except for SET TRANSACTION ISOLATION LEVEL).
    
d685 3
a687 3
    <programlisting>
     SET TIME ZONE { interval_value_expression | LOCAL }
    </programlisting>
d705 1
a705 1
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
@


1.25
log
@Fix some markup, but probably not finished yet...
@
text
@d204 1
a204 1
	  Running postmaster using the <option>-oe</option> parameter to set
d206 1
a206 1
	  Note that this affects only the some combinations of date styles; for example
@


1.25.2.1
log
@Correct typo in command line options for backend server.
@
text
@d204 1
a204 1
	  Running postmaster using the <option>-o -e</option> option to set
@


1.24
log
@Remove QUERY_LIMIT and documenation on same.  Change _ALIGN to TYPEALIGN
for Irix.
@
text
@d21 2
a22 3
SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } {
   '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL | DEFAULT };
d38 1
a38 1
       <replaceable class="PARAMETER">variable</replaceable>
d48 1
a48 1
       <replaceable class="PARAMETER">value</replaceable>
d65 1
a65 1
       CLIENT_ENCODING | NAMES
d69 1
a69 1
	Sets the multi-byte client encoding
d74 1
a74 1
	   <replaceable class="parameter">value</replaceable>
d87 1
a87 1
	   DEFAULT
d91 1
a91 1
	    Sets the multi-byte client encoding.
d106 1
a106 1
       DateStyle
d110 3
d116 1
a116 1
	   ISO
d126 1
a126 1
	   SQL
d136 1
a136 1
	   Postgres
d146 1
a146 1
	   European
d156 1
a156 1
	   NonEuropean
d166 1
a166 1
	   German
d176 1
a176 1
	   US
d186 1
a186 1
	   default
d198 1
a198 1
	Date format initialization my be done by:
d201 1
a201 1
	  Setting PGDATESTYLE environment variable.
d204 2
a205 2
	  Running postmaster using -oe parameter to set
	  dates to the 'European' convention.
d231 1
a231 1
       SERVER_ENCODING
d240 1
a240 1
	   <replaceable class="parameter">value</replaceable>
d244 1
a244 1
		Sets the multi-byte server encoding.
d251 1
a251 1
	   DEFAULT
d255 1
a255 1
		Sets the multi-byte server encoding.
d269 1
a269 1
       TIMEZONE
d283 1
a283 1
	   'PST8PDT'
d293 1
a293 1
	   'Portugal'
d303 1
a303 1
	   'Europe/Rome'
d313 1
a313 1
	   DEFAULT
d343 1
a343 1
       TRANSACTION ISOLATION LEVEL
d352 1
a352 1
	   READ COMMITTED
d371 1
a371 1
	   SERIALIZABLE
d398 1
a398 1
       COST_HEAP
d407 1
a407 1
	   <replaceable class="parameter">float4</replaceable>
d418 1
a418 1
	   DEFAULT
d437 1
a437 1
       COST_INDEX
d446 1
a446 1
	   <replaceable class="parameter">float4</replaceable>
d457 1
a457 1
	   DEFAULT
d477 1
a477 1
       GEQO
d486 1
a486 1
	   ON
d497 1
a497 1
	   ON=<replaceable class="parameter">#</replaceable>
d509 1
a509 1
	   OFF
d519 1
a519 1
	   DEFAULT
d550 1
a550 1
       KSQO
d561 1
a561 1
	   ON
d572 1
a572 1
	   OFF
d583 1
a583 1
	   DEFAULT
d622 1
a622 1
       <returnvalue>SET VARIABLE</returnvalue>
d633 1
a633 3
       <returnvalue>WARN:  Bad value for
	<replaceable class="parameter">variable</replaceable>
	(<replaceable class="parameter">value</replaceable>)</returnvalue>
d697 3
a699 4
  </para>
  <programlisting>
   --Set the style of date to ISO:
   --
d701 5
a705 4
  </programlisting>
  <programlisting> 
   --Enable GEQO for queries with 4 or more tables
   --
d707 5
a711 4
  </programlisting>
  <programlisting> 
   --Set GEQO to default:
   --
d713 5
a717 3
  </programlisting>
  <programlisting> 
   --set the timezone for Berkeley, California:
a718 1
   
d724 5
a728 3
  </programlisting>
  <programlisting> 
   --set the timezone for Italy:
a729 1
   
d735 2
a736 2
  </programlisting>
  
@


1.23
log
@Minor updates for release.
Split reference pages for CREATE TABLE AS and SELECT INTO to allow psgml
 (the emacs parser) to handle parsing.
@
text
@a603 37
     <varlistentry>
      <term>
       QUERY_LIMIT
      </term>
      <listitem>
       <para>
	Sets the maximum number of rows returned by a query.
	By default, there is no limit to the number of rows
	returned by a query.
       
	<variablelist>
	 <varlistentry>
	  <term>
	   <replaceable class="parameter">#</replaceable>
	  </term>
	  <listitem>
	   <para>
	    Sets the maximum number of rows returned by a
	    query to <replaceable class="parameter">#</replaceable>.
	   </para>
	  </listitem>
	 </varlistentry>
	 <varlistentry>
	  <term>
	   DEFAULT
	  </term>
	  <listitem>
	   <para>
	    Sets the maximum number of rows returned by a query to be unlimited.
	   </para>
	  </listitem>
	 </varlistentry>
	</variablelist>
       </para>
      </listitem>
     </varlistentry>

@


1.22
log
@Make minor changes in wording.
Adjust tags to get a clean build.
@
text
@d21 2
a22 1
SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } { '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
@


1.21
log
@MVCC updation.
@
text
@d9 1
a9 1
  <refname>
@


1.20
log
@Add input parameters for LOCK TABLE. Still needs explanation from Vadim.
Fix markup.
@
text
@d23 1
a23 1
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZED | DEFAULT }
d353 2
a354 2
	    The current transaction reads only 
	    committed rows.  READ COMMITTED is the default.
d356 7
d372 4
a375 3
	    The current transaction will place a 
	    lock on every row read, so later reads in that transaction 
	    see the rows unmodified by other transactions.
a379 11
	 <varlistentry>
	  <term>
	   DEFAULT
	  </term>
	  <listitem>
	   <para>
	    Sets the isolation level for the current transaction to
	    <option>READ COMMITTED</option>.
	   </para>
	  </listitem>
	 </varlistentry>
d789 1
a789 1
    in <acronym>SQL92</acronym>.
@


1.19
log
@Add description for SET TRANSACTION.
@
text
@d1 3
a3 3
<REFENTRY ID="SQL-SET">
 <REFMETA>
  <REFENTRYTITLE>
d5 5
a9 5
  </REFENTRYTITLE>
  <REFMISCINFO>SQL - Language Statements</REFMISCINFO>
 </REFMETA>
 <REFNAMEDIV>
  <REFNAME>
d11 2
a12 2
  </REFNAME>
  <REFPURPOSE>
d14 1
a14 1
  </REFPURPOSE>
d16 15
a30 14
 <REFSYNOPSISDIV>
  <REFSYNOPSISDIVINFO>
   <DATE>1998-09-24</DATE>
  </REFSYNOPSISDIVINFO>
  <SYNOPSIS>
SET <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> { TO | = } { '<REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>' | DEFAULT }
SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL };
  </SYNOPSIS>

  <REFSECT2 ID="R2-SQL-SET-1">
   <REFSECT2INFO>
    <DATE>1998-09-24</DATE>
   </REFSECT2INFO>
   <TITLE>
d32 2
a33 2
   </TITLE>
   <PARA>
d35 6
a40 6
    <VARIABLELIST>
     <VARLISTENTRY>
      <TERM>
       <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
      </TERM>
      <LISTITEM>
d48 1
a48 1
       <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>
d51 1
a51 1
       <PARA>
d58 1
d62 44
a105 3
    <VARIABLELIST>
     <VARLISTENTRY>
      <TERM>
d107 6
a112 7
      </TERM>
      <LISTITEM>
       <PARA>
	
	<VARIABLELIST>
	 <VARLISTENTRY>
	  <TERM>
d114 3
a116 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d121 2
a122 2
	 <VARLISTENTRY>
	  <TERM>
d124 3
a126 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d131 2
a132 2
	 <VARLISTENTRY>
	  <TERM>
d134 3
a136 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d141 2
a142 2
	 <VARLISTENTRY>
	  <TERM>
d144 3
a146 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d151 2
a152 2
	 <VARLISTENTRY>
	  <TERM>
d154 3
a156 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d161 2
a162 2
	 <VARLISTENTRY>
	  <TERM>
d164 3
a166 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d171 2
a172 2
	 <VARLISTENTRY>
	  <TERM>
d174 3
a176 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d181 2
a182 2
	 <VARLISTENTRY>
	  <TERM>
d184 3
a186 3
	  </TERM>
	  <LISTITEM>
	   <PARA>
d193 68
a262 30
    </variablelist>
   </para>
   <para>
    Date format initialization my be done by:
    <simplelist>
     <member>
      Setting PGDATESTYLE environment variable.
     </member>
     <member>
      Running postmaster using -oe parameter to set
      dates to the 'European' convention.
      Note that this affects only the some combinations of date styles; for example
      the ISO style is not affected by this parameter.
     </member>
     <member>
      Changing variables in 
      <filename>src/backend/utils/init/globals.c</filename>.
     </member>
    </simplelist>
   </para>
   <para>
    The variables in <filename>globals.c</filename> which can be changed are:
    <simplelist>
     <member>
      bool EuroDates = false | true
     </member>
     <member>
      int  DateStyle = USE_ISO_DATES | USE_POSTGRES_DATES | USE_SQL_DATES | USE_GERMAN_DATES
     </member>
    </simplelist>
a263 3
   </para>
   <para>
    <variablelist>
d337 50
d389 1
a431 34
       <variablelist>
	<varlistentry>
	 <term>
	  COST_INDEX
	 </term>
	 <listitem>
	  <para>
	   Sets the default cost of an index scan for use by the optimizer.
	  </para>
	 </listitem>
	</varlistentry>
	
	<varlistentry>
	 <term>
	  <replaceable class="parameter">float4</replaceable>
	 </term>
	 <listitem>
	  <para>
	   Set the cost of an index scan to the specified floating point value.
	  </para>
	 </listitem>
	</varlistentry>
	
	<varlistentry>
	 <term>
	  DEFAULT
	 </term>
	 <listitem>
	  <para>
	   Sets the cost of an index scan to the default value.
	  </para>
	 </listitem>
	</varlistentry>
       </variablelist>
d434 1
a434 7
    </variablelist>
   </para>
   <para>
    The frontend may be initialized by setting the PGCOSTINDEX
    environment variable.
    
    <variablelist>
d437 1
a437 1
       GEQO
d441 25
a465 1
	Sets the threshold for using the genetic optimizer algorithm.
d467 1
a467 71
       
       <variablelist>
	<varlistentry>
	 <term>
	  On
	 </term>
	 <listitem>
	  <para>
	   enables the genetic optimizer algorithm
	   for statements with 6 or more tables.
	  </para>
	 </listitem>
	</varlistentry>
	<varlistentry>
	 <term>
	  On=<replaceable class="parameter">#</replaceable>
	 </term>
	 <listitem>
	  <para>
	   Takes an integer argument to enable the genetic optimizer algorithm
	   for statements with <replaceable class="parameter">#</replaceable>
	   or more tables in the query.
	  </para>
	 </listitem>
	</varlistentry>
	<varlistentry>
	 <term>
	  Off
	 </term>
	 <listitem>
	  <para>
	   disables the genetic optimizer algorithm.
	  </para>
	 </listitem>
	</varlistentry>
	<varlistentry>
	 <term>
	  DEFAULT
	 </term>
	 <listitem>
	  <para>
	   Equivalent to specifying <command>SET GEQO='on'</command>
	  </para>
	 </listitem>
	</varlistentry>
       </variablelist>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
   <para>
    This algorithm is on by default, which used GEQO for
    statements of eleven or more tables.
    (See the chapter on GEQO in the Programmer's Guide
    for more information).
   </para>
   <para>
    The frontend may be initialized by setting PGGEQO
    environment variable.
   </para>
   <para>
    It may be useful when joining big relations with
    small ones. This algorithm is off by default.
    It's not used by GEQO anyway.
    
    <variablelist>
     <varlistentry>
      <term>
       KSQO
      </term>
      <listitem>
d469 2
a470 3
	<firstterm>Key Set Query Optimizer</firstterm> forces the query optimizer
	to optimize repetative OR clauses such as generated by
	<productname>MicroSoft Access</productname>:
a471 35
       
       <variablelist>
	<varlistentry>
	 <term>
	  On
	 </term>
	 <listitem>
	  <para>
	   enables this optimization.
	  </para>
	 </listitem>
	</varlistentry>
	
	<varlistentry>
	 <term>
	  Off
	 </term>
	 <listitem>
	  <para>
	   disables this optimization.
	  </para>
	 </listitem>
	</varlistentry>
	
	<varlistentry>
	 <term>
	  DEFAULT
	 </term>
	 <listitem>
	  <para>
	   Equivalent to specifying <command>SET KSQO='off'</command>.
	  </para>
	 </listitem>
	</varlistentry>
       </variablelist>
d474 1
a474 11
    </variablelist>
   </para>
   <para>
    It may be useful when joining big relations with
    small ones. This algorithm is off by default.
    It's not used by GEQO anyway.
   </para>
   <para>
    The frontend may be initialized by setting the PGKSQO
    environment variable.
    <variablelist>
d477 1
a477 1
       QUERY_LIMIT
d481 1
a481 2
	Sets the number of rows returned by a query.
       </para>
a482 51
       <variablelist>
	<varlistentry>
	 <term>
	  Value
	 </term>
	 <listitem>
	  <para>
	   Maximum number of rows to return for a query.  The default is to allow
	   an unlimited number of rows.
	  </para>
	 </listitem>
	</varlistentry>
	<varlistentry>
	 <term>
	  <replaceable class="parameter">#</replaceable>
	 </term>
	 <listitem>
	  <para>
	   Sets the maximum number of rows returned by a
	   query to <replaceable class="parameter">#</replaceable>.
	  </para>
	 </listitem>
	</varlistentry>
	<varlistentry>
	 <term>
	  DEFAULT
	 </term>
	 <listitem>
	  <para>
	   Sets the maximum number of rows returned by a query to be unlimited.
	  </para>
	 </listitem>
	</varlistentry>
       </variablelist>
       <para>
	By default, there is no limit to the number of rows
	returned by a query.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>

    <variablelist>
     <varlistentry>
      <term>
       TRANSACTION ISOLATION LEVEL
      </term>
      <listitem>
       <para>
	Sets the isolation level for the current transaction.
	
d486 24
a509 1
	   <replaceable class="parameter">value</replaceable>
d513 1
a513 7
		Sets the isolation level for the current transaction to
		'SERIALIZABLE' or 'READ COMMITTED'.
		SERIALIZABLE means that the current transaction will place a 
		lock on every row read, so later reads in that transaction 
		see the rows unmodified by other transactions.
		READ COMMITTED means that the current transaction reads only 
		committed rows.  READ COMMITTED is the default.
a516 2
   </para>
	 
d523 1
a523 2
		Sets the isolation level for the current transaction to
		'READ COMMITTED'.
d530 18
a547 1
    <variablelist>
d550 1
a550 1
       CLIENT_ENCODING | NAMES
d554 15
a568 1
	Sets the multi-byte client encoding
a569 1
	<variablelist>
d572 1
a572 1
	   <replaceable class="parameter">value</replaceable>
d576 1
a576 1
		Sets the multi-byte client encoding.
a579 1
   </para>
d587 1
a587 1
		Sets the multi-byte client encoding.
d593 6
d600 2
a601 1
	This is only enabled if multi-byte was specified to configure.
d603 2
a605 1
    <variablelist>
d608 1
a608 1
       SERVER_ENCODING
d612 4
a615 2
	Sets the multi-byte server encoding
	
d619 1
a619 1
	   <replaceable class="parameter">value</replaceable>
d623 2
a624 1
		Sets the multi-byte server encoding.
a627 2
   </para>
	 
d634 1
a634 1
		Sets the multi-byte server encoding.
d640 2
a641 4
       <para>
	This is only enabled if multi-byte was specified to configure.
       </para>

d643 3
d647 5
a651 7
  </REFSECT2>
  
  <REFSECT2 ID="R2-SQL-SET-2">
   <REFSECT2INFO>
    <DATE>1998-09-24</DATE>
   </REFSECT2INFO>
   <TITLE>
d653 2
a654 2
   </TITLE>
   <PARA>
d656 3
a658 3
    <VARIABLELIST>
     <VARLISTENTRY>
      <TERM>
d660 3
a662 3
      </TERM>
      <LISTITEM>
       <PARA>
d668 9
a676 7
     <VARLISTENTRY>
      <TERM>
       <returnvalue>WARN:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue>
      </TERM>
      <LISTITEM>
       <PARA>
	If the command fails to set variable.
d681 1
a681 1
    </VARIABLELIST>
d683 2
a684 2
  </REFSECT2>
 </REFSYNOPSISDIV>
d686 5
a690 5
 <REFSECT1 ID="R1-SQL-SET-1">
  <REFSECT1INFO>
   <DATE>1998-09-24</DATE>
  </REFSECT1INFO>
  <TITLE>
d692 2
a693 2
  </TITLE>
  <PARA>
d707 1
a707 1
   A SQL-session always begins with an initial default time zone
d713 5
a717 5
  <REFSECT2 ID="R2-SQL-SET-3">
   <REFSECT2INFO>
    <DATE>1998-09-24</DATE>
   </REFSECT2INFO>
   <TITLE>
d719 2
a720 2
   </TITLE>
   <PARA>
d728 2
a729 2
  </REFSECT2>
 </REFSECT1>
d731 2
a732 2
 <REFSECT1 ID="R1-SQL-SET-2">
  <TITLE>
d734 4
a737 4
  </TITLE>
  <PARA>
  </PARA>
  <ProgramListing>
d771 1
a771 1
  </ProgramListing>
d773 1
a773 1
 </REFSECT1>
d775 2
a776 2
 <REFSECT1 ID="R1-SQL-SET-3">
  <TITLE>
d778 3
a780 3
  </TITLE>
  <PARA>
  </PARA>
d782 5
a786 5
  <REFSECT2 ID="R2-SQL-SET-4">
   <REFSECT2INFO>
    <DATE>1998-09-24</DATE>
   </REFSECT2INFO>
   <TITLE>
d788 2
a789 2
   </TITLE>
   <PARA>
d804 1
a804 1
</REFENTRY>
@


1.18
log
@cleanup
@
text
@d548 5
d565 1
a565 1
		'SERIALIZABLE' or 'READ COMMITTED'.
@


1.17
log
@SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
                                ^^^^ required

Also note that SET TRANSACTION ISOLATION LEVEL change
isolevel for _current_ transaction, in accordance with
standard, not for session (ALTER SESSION is used in Oracle,
but it's not implemented currently).

And I would don't mention SET XACTISOLEVEL TO ...
form at all.

Please update set.sgml - I failed to understand all these

SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">

now.


for Vadim
@
text
@d560 1
a560 1
		'SERIALIZABLE' or 'COMMITTED'.
@


1.16
log
@Thanks for this, but SET TRANSACTION ISOLATION LEVEL
should be described like SET TIME ZONE: TO is not allowed, as well
as DEFAULT option. There are only two forms:

for Vadim.
@
text
@d537 1
a537 1
	Sets the isolation level for transactions.
d546 1
a546 1
		Sets the isolation level for transactions to
d559 1
a559 1
		Sets the isolation level for transactions to
@


1.15
log
@Add SET TRANSACTION ISOLATION LEVEL and SET NAMES mention.
@
text
@d533 1
a533 1
       XACTISOLEVEL | TRANSACTION ISOLATION LEVEL
d547 1
a547 1
		'SERIALIZABLE' or 'COMMITTED'.
@


1.14
log
@Update SET commands for psql \h, man pages, and sgml.
@
text
@d533 1
a533 1
       XACTISOLEVEL
d559 75
a633 1
	    Sets the cost of a heap scan to the default value.
d640 1
a640 2
	The frontend may be initialized by setting the PGCOSTHEAP
	environment variable.
@


1.13
log
@Add reference pages on user interface applications.
@
text
@d529 22
d552 20
@


1.12
log
@geqo now at 11 tables
@
text
@d2 11
a12 11
<REFMETA>
<REFENTRYTITLE>
SET
</REFENTRYTITLE>
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
</REFMETA>
<REFNAMEDIV>
<REFNAME>
SET
</REFNAME>
<REFPURPOSE>
d14 7
a20 9
</REFPURPOSE>
  </refnamediv>
<REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO>
<DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO>
<SYNOPSIS>
<REPLACEABLE CLASS="PARAMETER">
</REPLACEABLE>
d23 1
a23 1
</SYNOPSIS>
d25 8
a32 8
	<REFSECT2 ID="R2-SQL-SET-1">
	  <REFSECT2INFO>
		<DATE>1998-09-24</DATE>
	  </REFSECT2INFO>
	  <TITLE>
		Inputs
	  </TITLE>
	  <PARA>
d34 278
a311 22
		<VARIABLELIST>
		  <VARLISTENTRY>
			<TERM>
			  <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
			</TERM>
			<LISTITEM>
			  <para>
				Settable global parameter.
			  </para>
			</listitem>
		  </varlistentry>
		  <varlistentry>
			<term>
			  <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>
			</term>
			<listitem>
			  <PARA>
				New value of parameter.
			  </para>
			</listitem>
		  </varlistentry>
		</variablelist>
d313 8
d322 1
a322 283
		The possible variables and allowed values are:
		
		<VARIABLELIST>
		  <VARLISTENTRY>
			<TERM>
			  DateStyle
			</TERM>
			<LISTITEM>
			  <PARA>
				
				<VARIABLELIST>
				  <VARLISTENTRY>
					<TERM>
					  ISO
					</TERM>
					<LISTITEM>
					  <PARA>
						use ISO 8601-style dates and times
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  SQL
					</TERM>
					<LISTITEM>
					  <PARA>
						use Oracle/Ingres-style dates and times
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  Postgres
					</TERM>
					<LISTITEM>
					  <PARA>
						use traditional <productname>Postgres</productname> format
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  European
					</TERM>
					<LISTITEM>
					  <PARA>
						use dd/mm/yyyy for numeric date representations.
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  NonEuropean
					</TERM>
					<LISTITEM>
					  <PARA>
						use mm/dd/yyyy for numeric date representations.
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  German
					</TERM>
					<LISTITEM>
					  <PARA>
						use dd.mm.yyyy for numeric date representations.
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  US
					</TERM>
					<LISTITEM>
					  <PARA>
						same as 'NonEuropean'
					  </para>
					</listitem>
				  </varlistentry>
				  <VARLISTENTRY>
					<TERM>
					  default
					</TERM>
					<LISTITEM>
					  <PARA>
						restores the default values ('US,Postgres')
					  </para>
					</listitem>
				  </varlistentry>
				</variablelist>
			  </para>
			</listitem>
		  </varlistentry>
		</variablelist>
	  </para>
	  <para>
		Date format initialization my be done by:
		<simplelist>
		  <member>
			Setting PGDATESTYLE environment variable.
		  </member>
		  <member>
			Running postmaster using -oe parameter to set
			dates to the 'European' convention.
			Note that this affects only the some combinations of date styles; for example
			the ISO style is not affected by this parameter.
		  </member>
		  <member>
			Changing variables in 
			<filename>src/backend/utils/init/globals.c</filename>.
		  </member>
		</simplelist>
	  </para>
	  <para>
		The variables in <filename>globals.c</filename> which can be changed are:
		<programlisting>
		  bool EuroDates = false
		  true
		  int  DateStyle = USE_ISO_DATES
		  USE_POSTGRES_DATES
		  USE_ISO_DATES
		  USE_SQL_DATES
		  USE_GERMAN_DATES
		</programlisting>
	  </para>
	  <para>
		<variablelist>
		  <varlistentry>
			<term>
			  TIMEZONE
			</term>
			<listitem>
			  <para>
				The possible values for timezone depends on your operating
				system. For example on Linux /usr/lib/zoneinfo contains the
				database of timezones.
			  </para>
			  <para>
				Here are some valid values for timezone:
				
				<variablelist>
				  <varlistentry>
					<term>
					  'PST8PDT'
					</term>
					<listitem>
					  <para>
						set the timezone for California
				  </para>
					</listitem>
				  </varlistentry>
				  <varlistentry>
					<term>
					  'Portugal'
					</term>
					<listitem>
					  <para>
						set time zone for Portugal.
					  </para>
					</listitem>
				  </varlistentry>
				  <varlistentry>
					<term>
					  'Europe/Rome'
					</term>
					<listitem>
					  <para>
						set time zone for Italy.
					  </para>
					</listitem>
				  </varlistentry>
				  <varlistentry>
					<term>
					  DEFAULT
					</term>
					<listitem>
					  <para>
						set time zone to your local timezone
						(value of the TZ environment variable).
					  </para>
					</listitem>
				  </varlistentry>
				</variablelist>
			  </para>
			  <para>
				If an invalid time zone is specified, the time zone
				becomes GMT (on most systems anyway).
			  </para>
			  <para>
				A frontend which uses libpq may be initialized by setting the PGTZ
				environment variable.
			  </para>
			  <para>
				The second syntax shown above, allows one to set the timezone
				with a syntax similar to SQL92 <command>SET TIME ZONE</command>.
				The LOCAL keyword is just an alternate form
				of DEFAULT for SQL92 compatibility.
			  </para>
			</listitem>
		  </varlistentry>
		</variablelist>
	  </para>
	  <para>
		There are also several internal or optimization
		parameters which can be specified
		by the <command>SET</command> command:
		
		<variablelist>
		  <varlistentry>
			<term>
			  COST_HEAP
			</term>
			<listitem>
			  <para>
				Sets the default cost of a heap scan for use by the optimizer.
				
				<variablelist>
				  <varlistentry>
					<term>
					  <replaceable class="parameter">float4</replaceable>
					</term>
					<listitem>
					  <para>
						Set the cost of a heap scan to the specified floating point value.
					  </para>
					</listitem>
				  </varlistentry>
				  
				  <varlistentry>
					<term>
					  DEFAULT
					</term>
					<listitem>
					  <para>
						Sets the cost of a heap scan to the default value.
					  </para>
					</listitem>
				  </varlistentry>
				</variablelist>
			  </para>
			  <para>
				The frontend may be initialized by setting the PGCOSTHEAP
				environment variable.
			  </para>
			  <variablelist>
				<varlistentry>
				  <term>
					COST_INDEX
				  </term>
				  <listitem>
					<para>
					  Sets the default cost of an index scan for use by the optimizer.
					</para>
				  </listitem>
				</varlistentry>
				
				<varlistentry>
				  <term>
					<replaceable class="parameter">float4</replaceable>
				  </term>
				  <listitem>
					<para>
					  Set the cost of an index scan to the specified floating point value.
					</para>
				  </listitem>
				</varlistentry>
				
				<varlistentry>
				  <term>
					DEFAULT
				  </term>
				  <listitem>
					<para>
					  Sets the cost of an index scan to the default value.
					</para>
				  </listitem>
				</varlistentry>
			  </variablelist>
			</listitem>
		  </varlistentry>
		</variablelist>
d324 114
d439 1
a439 186
		The frontend may be initialized by setting the PGCOSTINDEX
		environment variable.
		
		<variablelist>
		  <varlistentry>
			<term>
			  GEQO
			</term>
			<listitem>
			  <para>
				Sets the threshold for using the genetic optimizer algorithm.
			  </para>
			  
			  <variablelist>
				<varlistentry>
				  <term>
					On
				  </term>
				  <listitem>
					<para>
					  enables the genetic optimizer algorithm
					  for statements with 6 or more tables.
					</para>
				  </listitem>
				</varlistentry>
				<varlistentry>
				  <term>
					On=<replaceable class="parameter">#</replaceable>
				  </term>
				  <listitem>
					<para>
					  Takes an integer argument to enable the genetic optimizer algorithm
					  for statements with <replaceable class="parameter">#</replaceable>
					  or more tables in the query.
					</para>
				  </listitem>
				</varlistentry>
				<varlistentry>
				  <term>
					Off
				  </term>
				  <listitem>
					<para>
					  disables the genetic optimizer algorithm.
					</para>
				  </listitem>
				</varlistentry>
				<varlistentry>
				  <term>
					DEFAULT
				  </term>
				  <listitem>
					<para>
					  Equivalent to specifying <command>SET GEQO='on'</command>
					</para>
				  </listitem>
				</varlistentry>
			  </variablelist>
			</listitem>
		  </varlistentry>
		</variablelist>
	  </para>
	  <para>
		This algorithm is on by default, which used GEQO for
		statements of eleven or more tables.
		(See the chapter on GEQO in the Programmer's Guide
		for more information).
	  </para>
	  <para>
		The frontend may be initialized by setting PGGEQO
		environment variable.
	  </para>
	  <para>
		It may be useful when joining big relations with
		small ones. This algorithm is off by default.
		It's not used by GEQO anyway.

		<variablelist>
		  <varlistentry>
			<term>
			  KSQO
			</term>
			<listitem>
			  <para>
				<firstterm>Key Set Query Optimizer</firstterm> forces the query optimizer
				to optimize repetative OR clauses such as generated by
				<productname>MicroSoft Access</productname>:
			  </para>
			  
			  <variablelist>
				<varlistentry>
				  <term>
					On
				  </term>
				  <listitem>
					<para>
					  enables this optimization.
					</para>
				  </listitem>
				</varlistentry>
				
				<varlistentry>
				  <term>
					Off
				  </term>
				  <listitem>
					<para>
					  disables this optimization.
					</para>
				  </listitem>
				</varlistentry>
				
				<varlistentry>
				  <term>
					DEFAULT
				  </term>
				  <listitem>
					<para>
					  Equivalent to specifying <command>SET KSQO='off'</command>.
					</para>
				  </listitem>
				</varlistentry>
			  </variablelist>
			</listitem>
		  </varlistentry>
		</variablelist>
	  </para>
	  <para>
		It may be useful when joining big relations with
		small ones. This algorithm is off by default.
		It's not used by GEQO anyway.
	  </para>
	  <para>
		The frontend may be initialized by setting the PGKSQO
		environment variable.
		<variablelist>
		  <varlistentry>
			<term>
			  QUERY_LIMIT
			</term>
			<listitem>
			  <para>
				Sets the number of rows returned by a query.
			  </para>
			  
			  <variablelist>
				<varlistentry>
				  <term>
					Value
				  </term>
				  <listitem>
					<para>
					  Maximum number of rows to return for a query.  The default is to allow
					  an unlimited number of rows.
					</para>
				  </listitem>
				</varlistentry>
				<varlistentry>
				  <term>
					<replaceable class="parameter">#</replaceable>
				  </term>
				  <listitem>
					<para>
					  Sets the maximum number of rows returned by a
					  query to <replaceable class="parameter">#</replaceable>.
					</para>
				  </listitem>
				</varlistentry>
				<varlistentry>
				  <term>
					DEFAULT
				  </term>
				  <listitem>
					<para>
					  Sets the maximum number of rows returned by a query to be unlimited.
					</para>
				  </listitem>
				</varlistentry>
			  </variablelist>
			  <para>
				By default, there is no limit to the number of rows
				returned by a query.
			  </para>
			</listitem>
		  </varlistentry>
		</variablelist>
d441 2
a442 1
	</REFSECT2>
d444 7
a450 33
	<REFSECT2 ID="R2-SQL-SET-2">
	  <REFSECT2INFO>
		<DATE>1998-09-24</DATE>
	  </REFSECT2INFO>
	  <TITLE>
		Outputs
	  </TITLE>
	  <PARA>
		
		<VARIABLELIST>
		  <VARLISTENTRY>
			<TERM>
			  <returnvalue>SET VARIABLE</returnvalue>
			</TERM>
			<LISTITEM>
			  <PARA>
				Message returned if successfully.
			  </para>
			</listitem>
		  </varlistentry>
		  
		  <VARLISTENTRY>
			<TERM>
			  <returnvalue>WARN:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue>
			</TERM>
			<LISTITEM>
			  <PARA>
				If the command fails to set variable.
			  </para>
			</listitem>
		  </varlistentry>
		  
		</VARIABLELIST>
d452 79
a530 2
	</REFSECT2>
  </REFSYNOPSISDIV>
d532 46
a577 9
  <REFSECT1 ID="R1-SQL-SET-1">
	<REFSECT1INFO>
	  <DATE>1998-09-24</DATE>
	</REFSECT1INFO>
	<TITLE>
	  Description
	</TITLE>
	<PARA>
	  <command>SET</command> will modify configuration parameters for variable during
d579 78
a656 16
	</para>
	<para>
	  Current values can be obtained using <command>SHOW</command>, and values
	  can be restored to the defaults using <command>RESET</command>.
	  Parameters and values are case-insensitive. Note that the value
	  field is always specified as a string, so is enclosed in
	  single-quotes.
	</para>
	<para>
	  <command>SET TIME ZONE</command> changes the session's
	  default time zone offset.
	  A SQL-session always begins with an initial default time zone
	  offset.
	  The <command>SET TIME ZONE</command> statement is used to change the default
	  time zone offset for the current SQL session.
	</para>
d658 30
a687 59
	<REFSECT2 ID="R2-SQL-SET-3">
	  <REFSECT2INFO>
		<DATE>1998-09-24</DATE>
	  </REFSECT2INFO>
	  <TITLE>
		Notes
	  </TITLE>
	  <PARA>
		The <command>SET <replaceable class="parameter">variable</replaceable></command>
		statement is a <productname>Postgres</productname> language extension.
	  </para>
	  <para>
		Refer to <command>SHOW</command> and <command>RESET</command> to 
		display or reset the current values.
	  </para>
	</REFSECT2>
  </REFSECT1>

  <REFSECT1 ID="R1-SQL-SET-2">
	<TITLE>
	  Usage
	</TITLE>
	<PARA>
	</PARA>
	<ProgramListing>
	  --Set the style of date to ISO:
	  --
	  SET DATESTYLE TO 'ISO';
	</programlisting>
	<programlisting> 
	  --Enable GEQO for queries with 4 or more tables
	  --
	  SET GEQO ON=4;
	</programlisting>
	<programlisting> 
	  --Set GEQO to default:
	  --
	  SET GEQO = DEFAULT;
	</programlisting>
	<programlisting> 
	  --set the timezone for Berkeley, California:
	  SET TIME ZONE 'PST8PDT';
	  
	  SELECT CURRENT_TIMESTAMP AS today;
	  
	  today
	  ----------------------
	  1998-03-31 07:41:21-08
	</programlisting>
	<programlisting> 
	  --set the timezone for Italy:
	  SET TIME ZONE 'Europe/Rome';
	  
	  SELECT CURRENT_TIMESTAMP AS today;
	  
	  today
	  ----------------------
	  1998-03-31 17:41:31+02
	</ProgramListing>
d689 16
a704 32
  </REFSECT1>

  <REFSECT1 ID="R1-SQL-SET-3">
	<TITLE>
	  Compatibility
	</TITLE>
	<PARA>
	</PARA>
	
	<REFSECT2 ID="R2-SQL-SET-4">
	  <REFSECT2INFO>
		<DATE>1998-09-24</DATE>
	  </REFSECT2INFO>
	  <TITLE>
		SQL92
	  </TITLE>
	  <PARA>
		There is no
		<command>SET <replaceable class="parameter">variable</replaceable></command>
		in <acronym>SQL92</acronym>.
		
		The <acronym>SQL92</acronym> syntax for <command>SET TIME ZONE</command>
		is slightly different,
		allowing only a single integer value for time zone specification:
		
		<programlisting>
		  SET TIME ZONE { interval_value_expression | LOCAL }
		</programlisting>
	  </para>
	</refsect2>
  </refsect1>
</REFENTRY>
@


1.11
log
@Enable bushy and right-hand queries by default.
@
text
@d409 1
a409 1
		statements of six or more tables.
@


1.10
log
@Optimizer rename.
@
text
@a415 49
	 
		<variablelist>
		  
		  <varlistentry>
			<term>
			  R_PLANS
			</term>
			<listitem>
			  <para>
				Determines whether right-hand plan evaluation is allowed:
			  </para>
			  
			  <variablelist>
				<varlistentry>
				  <term>
					On
				  </term>
				  <listitem>
					<para>
					  enables right-hand evaluation of plans.
					</para>
				  </listitem>
				</varlistentry>
				
				<varlistentry>
				  <term>
					Off
				  </term>
				  <listitem>
					<para>
					  disables right-hand evaluation of plans.
					</para>
				  </listitem>
				</varlistentry>
				
				<varlistentry>
				  <term>
					DEFAULT
				  </term>
				  <listitem>
					<para>
					  Equivalent to specifying <command>SET R_PLANS='off'</command>.
					</para>
				  </listitem>
				</varlistentry>
			  </variablelist>
			</listitem>
		  </varlistentry>
		</variablelist>
d421 1
a421 4
	  </para>
	  <para>
		The frontend may be initialized by setting the PGRPLANS
		environment variable.
d478 1
a478 1
		The frontend may be initialized by setting the PGRPLANS
a635 5
	</programlisting>
	<programlisting> 
	  --Turn on right-hand evaluation of plans:
	  --
	  SET R_PLANS TO 'on';
@


1.9
log
@Make GEQO use dependent on table and index count.
@
text
@d409 1
a409 1
		statements of six or more tables and indexes.
d680 1
a680 1
	  --Enable GEQO for queries with 4 or more tables and indexes
@


1.8
log
@Add TEMP tables/indexes.  Add COPY pfree().  Other cleanups.
@
text
@d409 1
a409 1
		statements of six or more tables.
d678 5
@


1.7
log
@Clean up to ensure tag completion as required by the newest versions
 of Norm's Modular Style Sheets and jade/docbook.
From Vince Vielhaber <vev@@michvhf.com>.
@
text
@d366 1
a366 1
					  for statements with 8 or more tables.
d409 1
a409 1
		statements of eight or more tables. 
@


1.6
log
@Minor cleanup in markup, especially in the Output section.
@
text
@d15 1
d27 605
a631 478
<REFSECT2 ID="R2-SQL-SET-1">
<REFSECT2INFO>
<DATE>1998-09-24</DATE>
</REFSECT2INFO>
<TITLE>
Inputs
</TITLE>
<PARA>

<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
</TERM>
<LISTITEM>
<para>
Settable global parameter.

<varlistentry>
<term>
<REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>
</term>
<listitem>
<PARA>
New value of parameter.
</variablelist>

<para>
The possible variables and allowed values are:

<VARIABLELIST>
<VARLISTENTRY>
<TERM>
DateStyle
</TERM>
<LISTITEM>
<PARA>

<VARIABLELIST>
<VARLISTENTRY>
<TERM>
ISO
</TERM>
<LISTITEM>
<PARA>
use ISO 8601-style dates and times
<VARLISTENTRY>
<TERM>
SQL
</TERM>
<LISTITEM>
<PARA>
use Oracle/Ingres-style dates and times
<VARLISTENTRY>
<TERM>
Postgres
</TERM>
<LISTITEM>
<PARA>
use traditional <productname>Postgres</productname> format
<VARLISTENTRY>
<TERM>
European
</TERM>
<LISTITEM>
<PARA>
use dd/mm/yyyy for numeric date representations.
<VARLISTENTRY>
<TERM>
NonEuropean
</TERM>
<LISTITEM>
<PARA>
use mm/dd/yyyy for numeric date representations.
<VARLISTENTRY>
<TERM>
German
</TERM>
<LISTITEM>
<PARA>
use dd.mm.yyyy for numeric date representations.
<VARLISTENTRY>
<TERM>
US
</TERM>
<LISTITEM>
<PARA>
same as 'NonEuropean'
<VARLISTENTRY>
<TERM>
default
</TERM>
<LISTITEM>
<PARA>
restores the default values ('US,Postgres')
</varlistentry>
</variablelist>

<para>
                Date format initialization my be done by:
<simplelist>
<member>
Setting PGDATESTYLE environment variable.

<member>
Running postmaster using -oe parameter to set
                        dates to the 'European' convention.
Note that this affects only the some combinations of date styles; for example
the ISO style is not affected by this parameter.
<member>
Changing variables in 
<filename>src/backend/utils/init/globals.c</filename>.
</simplelist>

<para>
The variables in <filename>globals.c</filename> which can be changed are:
<programlisting>
bool EuroDates = false
                 true
int  DateStyle = USE_ISO_DATES
                 USE_POSTGRES_DATES
                 USE_ISO_DATES
                 USE_SQL_DATES
                 USE_GERMAN_DATES
</programlisting>

</varlistentry>

<varlistentry>
<term>
TIMEZONE
</term>
<listitem>
<para>
                The possible values for timezone depends on your operating
                system. For example on Linux /usr/lib/zoneinfo contains the
                database of timezones.
<para>
                Here are some valid values for timezone:

<variablelist>
<varlistentry>
<term>
'PST8PDT'
</term>
<listitem>
<para>
set the timezone for California
<varlistentry>
<term>
'Portugal'
</term>
<listitem>
<para>
set time zone for Portugal.
<varlistentry>
<term>
'Europe/Rome'
</term>
<listitem>
<para>
set time zone for Italy.
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
set time zone to your local timezone
(value of the TZ environment variable).
</variablelist>

<para>
If an invalid time zone is specified, the time zone
becomes GMT (on most systems anyway).

<para>
A frontend which uses libpq may be initialized by setting the PGTZ
environment variable.

<para>
The second syntax shown above, allows one to set the timezone
with a syntax similar to SQL92 <command>SET TIME ZONE</command>.
The LOCAL keyword is just an alternate form
of DEFAULT for SQL92 compatibility.

</varlistentry>
</variablelist>

There are also several internal or optimization
 parameters which can be specified
by the <command>SET</command> command:

<variablelist>
<varlistentry>
<term>
COST_HEAP
</term>
<listitem>
<para>
Sets the default cost of a heap scan for use by the optimizer.

<variablelist>
<varlistentry>
<term>
<replaceable class="parameter">float4</replaceable>
</term>
<listitem>
<para>
Set the cost of a heap scan to the specified floating point value.

<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the cost of a heap scan to the default value.
</variablelist>

<para>
                The frontend may be initialized by setting the PGCOSTHEAP
                environment variable.

<varlistentry>
<term>
COST_INDEX
</term>
<listitem>
<para>
Sets the default cost of an index scan for use by the optimizer.

<variablelist>
<varlistentry>
<term>
<replaceable class="parameter">float4</replaceable>
</term>
<listitem>
<para>
Set the cost of an index scan to the specified floating point value.

<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the cost of an index scan to the default value.
</variablelist>

<para>
                The frontend may be initialized by setting the PGCOSTINDEX
                environment variable.

<varlistentry>
<term>
GEQO
</term>
<listitem>
<para>
Sets the threshold for using the genetic optimizer algorithm.

<variablelist>
<varlistentry>
<term>
On
</term>
<listitem>
<para>
enables the genetic optimizer algorithm
                           for statements with 8 or more tables.
<varlistentry>
<term>
On=<replaceable class="parameter">#</replaceable>
</term>
<listitem>
<para>
Takes an integer argument to enable the genetic optimizer algorithm
 for statements with <replaceable class="parameter">#</replaceable>
 or more tables in the query.
<varlistentry>
<term>
Off
</term>
<listitem>
<para>
disables the genetic optimizer algorithm.
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Equivalent to specifying <command>SET GEQO='on'</command>
</varlistentry>
</variablelist>

<para>
                This algorithm is on by default, which used GEQO for
                statements of eight or more tables. 
                (See the chapter on GEQO in the Programmer's Guide
for more information).

<para>
                The frontend may be initialized by setting PGGEQO
                environment variable.
</varlistentry>

<varlistentry>
<term>
R_PLANS
</term>
<listitem>
<para>
Determines whether right-hand plan evaluation is allowed:

<variablelist>
<varlistentry>
<term>
On
</term>
<listitem>
<para>
enables right-hand evaluation of plans.

<varlistentry>
<term>
Off
</term>
<listitem>
<para>
disables right-hand evaluation of plans.

<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Equivalent to specifying <command>SET R_PLANS='off'</command>.
</variablelist>

<para>
                It may be useful when joining big relations with
                small ones. This algorithm is off by default.
                It's not used by GEQO anyway.
<para>
                The frontend may be initialized by setting the PGRPLANS
                environment variable.
</varlistentry>

<varlistentry>
<term>
KSQO
</term>
<listitem>
<para>
<firstterm>Key Set Query Optimizer</firstterm> forces the query optimizer
to optimize repetative OR clauses such as generated by
<productname>MicroSoft Access</productname>:

<variablelist>
<varlistentry>
<term>
On
</term>
<listitem>
<para>
enables this optimization.

<varlistentry>
<term>
Off
</term>
<listitem>
<para>
disables this optimization.

<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Equivalent to specifying <command>SET KSQO='off'</command>.
</variablelist>

<para>
                It may be useful when joining big relations with
                small ones. This algorithm is off by default.
                It's not used by GEQO anyway.
<para>
                The frontend may be initialized by setting the PGRPLANS
                environment variable.

<varlistentry>
<term>
QUERY_LIMIT
</term>
<listitem>
<para>
Sets the number of rows returned by a query.

<variablelist>
<varlistentry>
<term>
Value
</term>
<listitem>
<para>
Maximum number of rows to return for a query.  The default is to allow
an unlimited number of rows.
<varlistentry>
<term>
<replaceable class="parameter">#</replaceable>
</term>
<listitem>
<para>
Sets the maximum number of rows returned by a
query to <replaceable class="parameter">#</replaceable>.
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the maximum number of rows returned by a query to be unlimited.
<para>
By default, there is no limit to the number of rows
returned by a query.
</varlistentry>

</variablelist>

</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2>

<REFSECT2 ID="R2-SQL-SET-2">
<REFSECT2INFO>
<DATE>1998-09-24</DATE>
</REFSECT2INFO>
<TITLE>
Outputs
</TITLE>
<PARA>

<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<returnvalue>SET VARIABLE</returnvalue>
</TERM>
<LISTITEM>
<PARA>
          Message returned if successfully.

<VARLISTENTRY>
<TERM>
<returnvalue>WARN:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue>
</TERM>
<LISTITEM>
<PARA>
          If the command fails to set variable.

</VARIABLELIST>

</REFSECT2>
</REFSYNOPSISDIV>

<REFSECT1 ID="R1-SQL-SET-1">
<REFSECT1INFO>
<DATE>1998-09-24</DATE>
</REFSECT1INFO>
<TITLE>
Description
</TITLE>
<PARA>
<command>SET</command> will modify configuration parameters for variable during
d633 108
a740 104

<para>
   Current values can be obtained using <command>SHOW</command>, and values
   can be restored to the defaults using <command>RESET</command>.
   Parameters and values are case-insensitive. Note that the value
   field is always specified as a string, so is enclosed in
   single-quotes.
<para>
   <command>SET TIME ZONE</command> changes the session's
 default time zone offset.
   A SQL-session always begins with an initial default time zone
   offset.
   The <command>SET TIME ZONE</command> statement is used to change the default
   time zone offset for the current SQL session.

<REFSECT2 ID="R2-SQL-SET-3">
<REFSECT2INFO>
<DATE>1998-09-24</DATE>
</REFSECT2INFO>
<TITLE>
Notes
</TITLE>
<PARA>
The <command>SET <replaceable class="parameter">variable</replaceable></command>
 statement is a <productname>Postgres</productname> language extension.

<para>
   Refer to <command>SHOW</command> and <command>RESET</command> to 
display or reset the current values.

</REFSECT2>
</REFSECT1>

<REFSECT1 ID="R1-SQL-SET-2">
<TITLE>
Usage
</TITLE>
<PARA>
</PARA>
<ProgramListing>
--Set the style of date to ISO:
--
SET DATESTYLE TO 'ISO';
</programlisting>
<programlisting> 
--Set GEQO to default:
--
SET GEQO = DEFAULT;
</programlisting>
<programlisting> 
--Turn on right-hand evaluation of plans:
--
SET R_PLANS TO 'on';
</programlisting>
<programlisting> 
--set the timezone for Berkeley, California:
SET TIME ZONE 'PST8PDT';

SELECT CURRENT_TIMESTAMP AS today;

   today
   ----------------------
   1998-03-31 07:41:21-08
</programlisting>
<programlisting> 
--set the timezone for Italy:
SET TIME ZONE 'Europe/Rome';

SELECT CURRENT_TIMESTAMP AS today;

   today
   ----------------------
   1998-03-31 17:41:31+02
</ProgramListing>

</REFSECT1>

<REFSECT1 ID="R1-SQL-SET-3">
<TITLE>
Compatibility
</TITLE>
<PARA>
</PARA>

<REFSECT2 ID="R2-SQL-SET-4">
<REFSECT2INFO>
<DATE>1998-09-24</DATE>
</REFSECT2INFO>
<TITLE>
SQL92
</TITLE>
<PARA>
   There is no
<command>SET <replaceable class="parameter">variable</replaceable></command>
   in <acronym>SQL92</acronym>.

   The <acronym>SQL92</acronym> syntax for <command>SET TIME ZONE</command>
 is slightly different,
 allowing only a single integer value for time zone specification:

<programlisting>
SET TIME ZONE { interval_value_expression | LOCAL }
</programlisting>

@


1.5
log
@Minor fixes in markup.
Include cross-references in NOTIFY and UNLISTEN.
@
text
@a475 8
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>

<VARIABLELIST>
<VARLISTENTRY>
<TERM>
d489 1
a489 2
</VARLISTENTRY>
</VARIABLELIST>
@


1.4
log
@Remove duplicate entry for R_PLAN (thanks Bruce).
Add entry for undocumented (?) KSQO.
@
text
@a452 2
</varlistentry>

d456 2
@


1.3
log
@New QUERY_LIMIT set command.
@
text
@a22 1

d54 1
a54 1
         The possible variables and allowed values are:
d199 3
a201 2
                If an invalid time zone is specified, the time zone
                becomes GMT (on most systems anyway).
d203 3
a205 2
                A frontend which uses libpq may be initialized by setting the PGTZ
                environment variable.
d207 4
a210 4
                The second syntax shown above, allows one to set the timezone
                with a syntax similar to SQL92 <command>SET TIME ZONE</command>.
                The LOCAL keyword is just an alternate form
                of DEFAULT for SQL92 compatibility.
d319 1
a319 1
Equivalent to specifying <command>SET GEQO=On</command>
d365 1
a365 1
Equivalent to specifying <command>SET R_PLANS=Off</command>.
d379 1
a379 1
R_PLANS
d383 3
a385 1
Determines whether right-hand plan evaluation is allowed:
d394 1
a394 1
enables right-hand evaluation of plans.
d402 1
a402 1
disables right-hand evaluation of plans.
d410 1
a410 1
Equivalent to specifying <command>SET R_PLANS=Off</command>.
d436 2
a437 1
Maximum number of rows to return for a query.  The default is unlimited.
d452 1
a452 1
Sets the number of rows returned by a query to unlimited.
d456 2
a457 2
                By default, there is no limit to the number of rows
		returned by a query.
@


1.2
log
@Cleanup markup and minor editing to prepare for first release.
@
text
@d418 38
@


1.1
log
@Add new files from Oliver and Thomas.
@
text
@d17 1
a17 1
<DATE>1998-08-31</DATE>
d29 1
a29 1
<DATE>1998-08-31</DATE>
d35 1
d214 2
a215 1
There are also several internal or optimization parameters which can be specified
d298 1
a298 1
On=#
d302 3
a304 2
enables the genetic optimizer algorithm
                           for statements with # or more tables.
d424 1
a424 1
<DATE>1998-08-31</DATE>
d430 9
a438 1
</PARA>
d442 1
a442 1
   SET VARIABLE
d450 1
a450 1
   WARN:  Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)
d454 1
a454 1
          If fails to set variable.
d457 1
d464 1
a464 1
<DATE>1998-08-31</DATE>
d470 1
a470 1
SET will modify configuration parameters for variable during
d474 2
a475 2
   Current values can be obtained using SHOW statement, and values
   can be restored to the defaults using RESET statement.
d480 2
a481 1
   SET TIME ZONE changes the session's default time zone offset.
d484 1
a484 1
   The SET TIME ZONE statement is used to change the default
d489 1
a489 1
<DATE>1998-08-31</DATE>
d499 2
a500 1
   Refer to SHOW/RESET statements to show/reset variable values.
d512 3
a514 3
   --Set the style of date to ISO:
   --
   SET DATESTYLE TO 'ISO';
d517 3
a519 3
   --Set GEQO to default:
   --
   SET GEQO = DEFAULT;
d522 3
a524 3
   --Turn on right-hand evaluation of plans:
   --
   SET R_PLANS TO 'on';
d527 2
a528 2
   --set the timezone for Berkeley, California:
   SET TIME ZONE 'PST8PDT';
d530 1
a530 1
   SELECT CURRENT_TIMESTAMP AS today;
d537 2
a538 2
   --set the timezone for Italy:
   SET TIME ZONE 'Europe/Rome';
d540 1
a540 1
   SELECT CURRENT_TIMESTAMP AS today;
d558 1
a558 1
<DATE>1998-04-15</DATE>
d566 1
a566 1
   in SQL92.
d568 2
a569 1
   The SQL92 syntax for SET TIME ZONE is slightly different,
a576 20

<!--
<REPLACEABLE CLASS="PARAMETER">
</REPLACEABLE>
<ReturnValue></ReturnValue>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>&bull;
</TERM>
<LISTITEM>
<PARA>
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>
</PARA>
-->
@
