Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5e86ea

Browse files
committed
Add "xid <> xid" and "xid <> int4" operators.
The corresponding "=" operators have been there a long time, and nothaving their negators is a bit of a nuisance.Michael Paquier
1 parent9042f58 commitc5e86ea

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed

‎src/backend/utils/adt/xid.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ xideq(PG_FUNCTION_ARGS)
8787
PG_RETURN_BOOL(TransactionIdEquals(xid1,xid2));
8888
}
8989

90+
/*
91+
*xidneq- are two xids different?
92+
*/
93+
Datum
94+
xidneq(PG_FUNCTION_ARGS)
95+
{
96+
TransactionIdxid1=PG_GETARG_TRANSACTIONID(0);
97+
TransactionIdxid2=PG_GETARG_TRANSACTIONID(1);
98+
99+
PG_RETURN_BOOL(!TransactionIdEquals(xid1,xid2));
100+
}
101+
90102
/*
91103
*xid_age- compute age of an XID (relative to latest stable xid)
92104
*/

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201510161
56+
#defineCATALOG_VERSION_NO201511071
5757

5858
#endif

‎src/include/catalog/pg_operator.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,14 @@ DESCR("prepend element onto front of array");
144144
DATA(insertOID=375 ("||"PGNSPPGUIDbff22772277227700array_cat-- ));
145145
DESCR("concatenate");
146146

147-
DATA(insertOID=352 ("="PGNSPPGUIDbft2828163520xideqeqseleqjoinsel ));
147+
DATA(insertOID=352 ("="PGNSPPGUIDbft2828163523315xideqeqseleqjoinsel ));
148148
DESCR("equal");
149-
DATA(insertOID=353 ("="PGNSPPGUIDbff28231600xideqint4eqseleqjoinsel ));
149+
DATA(insertOID=353 ("="PGNSPPGUIDbff28231603316xideqint4eqseleqjoinsel ));
150150
DESCR("equal");
151+
DATA(insertOID=3315 ("<>"PGNSPPGUIDbff2828163315352xidneqneqselneqjoinsel ));
152+
DESCR("not equal");
153+
DATA(insertOID=3316 ("<>"PGNSPPGUIDbff2823160353xidneqint4neqselneqjoinsel ));
154+
DESCR("not equal");
151155
DATA(insertOID=388 ("!"PGNSPPGUIDrff200170000numeric_fac-- ));
152156
DESCR("factorial");
153157
DATA(insertOID=389 ("!!"PGNSPPGUIDlff020170000numeric_fac-- ));

‎src/include/catalog/pg_proc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ DATA(insert OID = 65 ( int4eq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0
212212
DATA(insert OID = 66 ( int4lt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "23 23" _null_ _null_ _null_ _null_ _null_ int4lt _null_ _null_ _null_ ));
213213
DATA(insert OID = 67 ( texteq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "25 25" _null_ _null_ _null_ _null_ _null_ texteq _null_ _null_ _null_ ));
214214
DATA(insert OID = 68 ( xideq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "28 28" _null_ _null_ _null_ _null_ _null_ xideq _null_ _null_ _null_ ));
215+
DATA(insert OID = 3308 ( xidneq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "28 28" _null_ _null_ _null_ _null_ _null_ xidneq _null_ _null_ _null_ ));
215216
DATA(insert OID = 69 ( cideq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "29 29" _null_ _null_ _null_ _null_ _null_ cideq _null_ _null_ _null_ ));
216217
DATA(insert OID = 70 ( charne PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "18 18" _null_ _null_ _null_ _null_ _null_ charne _null_ _null_ _null_ ));
217218
DATA(insert OID = 1246 ( charlt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "18 18" _null_ _null_ _null_ _null_ _null_ charlt _null_ _null_ _null_ ));
@@ -1515,6 +1516,7 @@ DATA(insert OID = 1318 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2
15151516
DESCR("character length");
15161517

15171518
DATA(insert OID = 1319 ( xideqint4 PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "28 23" _null_ _null_ _null_ _null_ _null_ xideq _null_ _null_ _null_ ));
1519+
DATA(insert OID = 3309 ( xidneqint4 PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "28 23" _null_ _null_ _null_ _null_ _null_ xidneq _null_ _null_ _null_ ));
15181520

15191521
DATA(insert OID = 1326 ( interval_div PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1186 "1186 701" _null_ _null_ _null_ _null_ _null_interval_div _null_ _null_ _null_ ));
15201522

‎src/include/utils/builtins.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ extern Datum xidout(PG_FUNCTION_ARGS);
860860
externDatumxidrecv(PG_FUNCTION_ARGS);
861861
externDatumxidsend(PG_FUNCTION_ARGS);
862862
externDatumxideq(PG_FUNCTION_ARGS);
863+
externDatumxidneq(PG_FUNCTION_ARGS);
863864
externDatumxid_age(PG_FUNCTION_ARGS);
864865
externDatummxid_age(PG_FUNCTION_ARGS);
865866
externintxidComparator(constvoid*arg1,constvoid*arg2);

‎src/test/regress/expected/opr_sanity.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,8 @@ uuid_eq(uuid,uuid)
641641
uuid_ge(uuid,uuid)
642642
uuid_gt(uuid,uuid)
643643
uuid_ne(uuid,uuid)
644+
xidneq(xid,xid)
645+
xidneqint4(xid,integer)
644646
-- restore normal output mode
645647
\a\t
646648
-- List of functions used by libpq's fe-lobj.c

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp