protocol
- 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 "SSLv2", "SSLv3",
+ "TLSv1", "TLSv1.1"
+ and "TLSv1.2", but an implementation may
return other strings if some other protocol is used.
cipher
- A short name of the ciphersuite used, e.g.
+ A short name of the ciphersuite used, e.g.
"DHE-RSA-DES-CBC3-SHA". The names are specific
to each SSL implementation.
connections.)
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:
- 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;
Example assumes a unique index has been defined that constrains
values appearing in the did column:
- 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;
used to limit the rows actually updated (any existing row not
updated will still be locked, though):
- -- 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;
is_active boolean column evaluates to
true:
- -- 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;