mirror of
https://github.com/postgres/postgres.git
synced 2025-11-03 09:13:20 +03:00
This avoids leaving dangling links in pg_operator; which while fairly harmless are also unsightly. While we're at it, simplify OperatorUpd, which went through heap_modify_tuple for no very good reason considering it had already made a tuple copy it could just scribble on. Roma Sokolov, reviewed by Tomas Vondra, additional hacking by Robert Haas and myself.
57 lines
1.3 KiB
SQL
57 lines
1.3 KiB
SQL
CREATE OPERATOR === (
|
|
PROCEDURE = int8eq,
|
|
LEFTARG = bigint,
|
|
RIGHTARG = bigint,
|
|
COMMUTATOR = ===
|
|
);
|
|
|
|
CREATE OPERATOR !== (
|
|
PROCEDURE = int8ne,
|
|
LEFTARG = bigint,
|
|
RIGHTARG = bigint,
|
|
NEGATOR = ===,
|
|
COMMUTATOR = !==
|
|
);
|
|
|
|
DROP OPERATOR !==(bigint, bigint);
|
|
|
|
SELECT ctid, oprcom
|
|
FROM pg_catalog.pg_operator fk
|
|
WHERE oprcom != 0 AND
|
|
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.oprcom);
|
|
|
|
SELECT ctid, oprnegate
|
|
FROM pg_catalog.pg_operator fk
|
|
WHERE oprnegate != 0 AND
|
|
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.oprnegate);
|
|
|
|
DROP OPERATOR ===(bigint, bigint);
|
|
|
|
CREATE OPERATOR <| (
|
|
PROCEDURE = int8lt,
|
|
LEFTARG = bigint,
|
|
RIGHTARG = bigint
|
|
);
|
|
|
|
CREATE OPERATOR |> (
|
|
PROCEDURE = int8gt,
|
|
LEFTARG = bigint,
|
|
RIGHTARG = bigint,
|
|
NEGATOR = <|,
|
|
COMMUTATOR = <|
|
|
);
|
|
|
|
DROP OPERATOR |>(bigint, bigint);
|
|
|
|
SELECT ctid, oprcom
|
|
FROM pg_catalog.pg_operator fk
|
|
WHERE oprcom != 0 AND
|
|
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.oprcom);
|
|
|
|
SELECT ctid, oprnegate
|
|
FROM pg_catalog.pg_operator fk
|
|
WHERE oprnegate != 0 AND
|
|
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.oprnegate);
|
|
|
|
DROP OPERATOR <|(bigint, bigint);
|