mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Fix markup, other minor editing for recent btree_gist doc changes.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/btree-gist.sgml,v 1.6 2010/08/02 16:26:48 rhaas Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/btree-gist.sgml,v 1.7 2010/08/03 15:15:31 tgl Exp $ -->
|
||||||
|
|
||||||
<sect1 id="btree-gist">
|
<sect1 id="btree-gist">
|
||||||
<title>btree_gist</title>
|
<title>btree_gist</title>
|
||||||
@ -29,10 +29,10 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
In addition to the typical btree search operators, btree_gist also
|
In addition to the typical btree search operators, btree_gist also
|
||||||
provides search operators for <literal><></literal> ("not
|
provides search operators for <literal><></literal> (<quote>not
|
||||||
equals"). This may be useful in combination with an
|
equals</quote>). This may be useful in combination with an
|
||||||
<link linkend="SQL-CREATETABLE-EXCLUDE">Exclusion Constraint</link>,
|
<link linkend="SQL-CREATETABLE-EXCLUDE">exclusion constraint</link>,
|
||||||
as descibed below.
|
as described below.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
@ -51,26 +51,26 @@ SELECT * FROM test WHERE a < 10;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Example using an <link linkend="SQL-CREATETABLE-EXCLUDE">Exclusion
|
Use an <link linkend="SQL-CREATETABLE-EXCLUDE">exclusion
|
||||||
Constraint</link> to enforce the constraint that a cage at a zoo
|
constraint</link> to enforce the rule that a cage at a zoo
|
||||||
can contain only one kind of animal:
|
can contain only one kind of animal:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
=> CREATE TABLE zoo (
|
=> CREATE TABLE zoo (
|
||||||
cage INTEGER,
|
cage INTEGER,
|
||||||
animal TEXT,
|
animal TEXT,
|
||||||
EXCLUDE USING gist (cage WITH =, animal WITH <>)
|
EXCLUDE USING gist (cage WITH =, animal WITH <>)
|
||||||
);
|
);
|
||||||
|
|
||||||
=> INSERT INTO zoo VALUES(123, 'zebra');
|
=> INSERT INTO zoo VALUES(123, 'zebra');
|
||||||
INSERT 0 1
|
INSERT 0 1
|
||||||
=> INSERT INTO zoo VALUES(123, 'zebra');
|
=> INSERT INTO zoo VALUES(123, 'zebra');
|
||||||
INSERT 0 1
|
INSERT 0 1
|
||||||
=> INSERT INTO zoo VALUES(123, 'lion');
|
=> INSERT INTO zoo VALUES(123, 'lion');
|
||||||
ERROR: conflicting key value violates exclusion constraint "zoo_cage_animal_excl"
|
ERROR: conflicting key value violates exclusion constraint "zoo_cage_animal_excl"
|
||||||
DETAIL: Key (cage, animal)=(123, lion) conflicts with existing key (cage, animal)=(123, zebra).
|
DETAIL: Key (cage, animal)=(123, lion) conflicts with existing key (cage, animal)=(123, zebra).
|
||||||
=> INSERT INTO zoo VALUES(124, 'lion');
|
=> INSERT INTO zoo VALUES(124, 'lion');
|
||||||
INSERT 0 1
|
INSERT 0 1
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user