<term><literal>protocol</literal></term>
<listitem>
<para>
- SSL/TLS version in use. Common values are "SSLv2", "SSLv3",
- "TLSv1", "TLSv1.1" and "TLSv1.2", but an implementation may
+ SSL/TLS version in use. Common values
+ are <literal>"SSLv2"</literal>, <literal>"SSLv3"</literal>,
+ <literal>"TLSv1"</literal>, <literal>"TLSv1.1"</literal>
+ and <literal>"TLSv1.2"</literal>, but an implementation may
return other strings if some other protocol is used.
</para>
</listitem>
<term><literal>cipher</literal></term>
<listitem>
<para>
- A short name of the ciphersuite used, e.g.
+ A short name of the ciphersuite used, e.g.
<literal>"DHE-RSA-DES-CBC3-SHA"</literal>. The names are specific
to each SSL implementation.
</para>
connections.)
</para>
- <para>
+ <para>
The result is 1 if the termination message was sent; or in
nonblocking mode, this may only indicate that the termination
message was successfully queued. (In nonblocking mode, to be
expression is used to reference values originally proposed for
insertion:
<programlisting>
- INSERT INTO distributors (did, dname)
- VALUES (5, 'Gizmo transglobal'), (6, 'Associated Computing, inc')
- ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname;
+INSERT INTO distributors (did, dname)
+ VALUES (5, 'Gizmo transglobal'), (6, 'Associated Computing, inc')
+ ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname;
</programlisting>
</para>
<para>
Example assumes a unique index has been defined that constrains
values appearing in the <literal>did</literal> column:
<programlisting>
- INSERT INTO distributors (did, dname) VALUES (7, 'Redline GmbH')
- ON CONFLICT (did) DO NOTHING;
+INSERT INTO distributors (did, dname) VALUES (7, 'Redline GmbH')
+ ON CONFLICT (did) DO NOTHING;
</programlisting>
</para>
<para>
used to limit the rows actually updated (any existing row not
updated will still be locked, though):
<programlisting>
- -- Don't update existing distributors based in a certain ZIP code
- INSERT INTO distributors AS d (did, dname) VALUES (8, 'Anvil Distribution')
- ON CONFLICT (did) DO UPDATE
- SET dname = EXCLUDED.dname || ' (formerly ' || d.dname || ')'
- WHERE d.zipcode != '21201';
-
- -- Name a constraint directly in the statement (uses associated
- -- index to arbitrate taking the DO NOTHING action)
- INSERT INTO distributors (did, dname) VALUES (9, 'Antwerp Design')
- ON CONFLICT ON CONSTRAINT distributors_pkey DO NOTHING;
+-- Don't update existing distributors based in a certain ZIP code
+INSERT INTO distributors AS d (did, dname) VALUES (8, 'Anvil Distribution')
+ ON CONFLICT (did) DO UPDATE
+ SET dname = EXCLUDED.dname || ' (formerly ' || d.dname || ')'
+ WHERE d.zipcode <> '21201';
+
+-- Name a constraint directly in the statement (uses associated
+-- index to arbitrate taking the DO NOTHING action)
+INSERT INTO distributors (did, dname) VALUES (9, 'Antwerp Design')
+ ON CONFLICT ON CONSTRAINT distributors_pkey DO NOTHING;
</programlisting>
</para>
<para>
<literal>is_active</literal> boolean column evaluates to
<literal>true</literal>:
<programlisting>
- -- This statement could infer a partial unique index on "did"
- -- with a predicate of "WHERE is_active", but it could also
- -- just use a regular unique constraint on "did"
- INSERT INTO distributors (did, dname) VALUES (10, 'Conrad International')
- ON CONFLICT (did) WHERE is_active DO NOTHING;
+-- This statement could infer a partial unique index on "did"
+-- with a predicate of "WHERE is_active", but it could also
+-- just use a regular unique constraint on "did"
+INSERT INTO distributors (did, dname) VALUES (10, 'Conrad International')
+ ON CONFLICT (did) WHERE is_active DO NOTHING;
</programlisting>
</para>
</refsect1>