]> granicus.if.org Git - postgresql/commitdiff
Implement the <> operator for the tid type. Original patch from Mark
authorNeil Conway <neilc@samurai.com>
Sun, 26 Feb 2006 18:36:23 +0000 (18:36 +0000)
committerNeil Conway <neilc@samurai.com>
Sun, 26 Feb 2006 18:36:23 +0000 (18:36 +0000)
Kirkwood, minor improvements by Neil Conway. The regression tests have
been updated and the catversion has been bumped.

src/backend/utils/adt/tid.c
src/include/catalog/catversion.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/test/regress/expected/transactions.out
src/test/regress/sql/transactions.sql

index ba33ce50ee543d471b85b01bd90750ca0cb11c15..0fbc569a0dfaaaa4c61bcd52d97e6896ba9ebf3a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tid.c,v 1.49 2005/05/27 00:57:49 neilc Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tid.c,v 1.50 2006/02/26 18:36:21 neilc Exp $
  *
  * NOTES
  *       input routine largely stolen from boxin().
@@ -174,7 +174,6 @@ tideq(PG_FUNCTION_ARGS)
                                   arg1->ip_posid == arg2->ip_posid);
 }
 
-#ifdef NOT_USED
 Datum
 tidne(PG_FUNCTION_ARGS)
 {
@@ -185,7 +184,6 @@ tidne(PG_FUNCTION_ARGS)
                                   BlockIdGetBlockNumber(&(arg2->ip_blkid)) ||
                                   arg1->ip_posid != arg2->ip_posid);
 }
-#endif
 
 /*
  *     Functions to get latest tid of a specified tuple.
index 1c2ac77ea1f14ffea9798f343c2c451d87a82f44..1a391bad3f3994388a6bc486080df396cc351ac0 100644 (file)
@@ -37,7 +37,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.315 2006/02/12 03:22:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.316 2006/02/26 18:36:21 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200602112
+#define CATALOG_VERSION_NO     200602251
 
 #endif
index 72625937c321e3f14116ee167b97d901392e4596..a746bff271191487bfa9889e884ed2146336249c 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.139 2006/02/11 03:32:39 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.140 2006/02/26 18:36:21 neilc Exp $
  *
  * NOTES
  *       the genbki.sh script reads this file and generates .bki
@@ -130,6 +130,7 @@ DATA(insert OID = 385 (  "="           PGNSP PGUID b t      29      29      16 385   0       0       0       0       0 cide
 DATA(insert OID = 386 (  "="      PGNSP PGUID b t      22      22      16 386   0       0       0       0       0 int2vectoreq eqsel eqjoinsel ));
 DATA(insert OID = 387 (  "="      PGNSP PGUID b f      27      27      16 387   0       0       0       0       0 tideq eqsel eqjoinsel ));
 #define TIDEqualOperator   387
+DATA(insert OID = 402 (  "<>"     PGNSP PGUID b f      27      27      16 402   0       0       0       0       0 tidne neqsel neqjoinsel ));
 
 DATA(insert OID = 410 ( "="               PGNSP PGUID b t      20      20      16 410 411 412 412 412 413 int8eq eqsel eqjoinsel ));
 DATA(insert OID = 411 ( "<>"      PGNSP PGUID b f      20      20      16 411 410 0 0 0 0 int8ne neqsel neqjoinsel ));
index d8700b8759ef36bf365f6248c68ca5df3f0b2545..ec43235eef3ab5a0e82fabbcfb687d6e187d1dac 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.397 2006/02/12 03:22:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.398 2006/02/26 18:36:21 neilc Exp $
  *
  * NOTES
  *       The script catalog/genbki.sh reads this file and generates .bki
@@ -1598,6 +1598,8 @@ DATA(insert OID = 1293 ( currtid             PGNSP PGUID 12 f f t f v 2 27 "26 27" _null
 DESCR("latest tid of a tuple");
 DATA(insert OID = 1294 ( currtid2                 PGNSP PGUID 12 f f t f v 2 27 "25 27" _null_ _null_ _null_ currtid_byrelname - _null_ ));
 DESCR("latest tid of a tuple");
+DATA(insert OID = 2398 ( tidne                    PGNSP PGUID 12 f f t f i 2 16 "27 27" _null_ _null_ _null_ tidne - _null_ ));
+DESCR("not equal");
 
 DATA(insert OID = 2168 ( pg_database_size              PGNSP PGUID 12 f f t f v 1 20 "19" _null_ _null_ _null_ pg_database_size_name - _null_ ));
 DESCR("Calculate total disk space usage for the specified database");
index d79749a8a4f74a51d92a60bf504b38213a604f95..28a70d11ce7515edf350ee960384a8587c405f85 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.273 2006/02/11 03:32:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.274 2006/02/26 18:36:22 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -531,6 +531,7 @@ extern Datum tidout(PG_FUNCTION_ARGS);
 extern Datum tidrecv(PG_FUNCTION_ARGS);
 extern Datum tidsend(PG_FUNCTION_ARGS);
 extern Datum tideq(PG_FUNCTION_ARGS);
+extern Datum tidne(PG_FUNCTION_ARGS);
 extern Datum currtid_byreloid(PG_FUNCTION_ARGS);
 extern Datum currtid_byrelname(PG_FUNCTION_ARGS);
 
index 06a8a8f47c5b209b78d20fefe0a8e4db166d943b..047bba8f70a6ae8698cd9ce540da085a72f4e2f6 100644 (file)
@@ -517,3 +517,28 @@ fetch from foo;
 (1 row)
 
 abort;
+-- tests for the "tid" type
+SELECT '(3, 3)'::tid = '(3, 4)'::tid;
+ ?column? 
+----------
+ f
+(1 row)
+
+SELECT '(3, 3)'::tid = '(3, 3)'::tid;
+ ?column? 
+----------
+ t
+(1 row)
+
+SELECT '(3, 3)'::tid <> '(3, 3)'::tid;
+ ?column? 
+----------
+ f
+(1 row)
+
+SELECT '(3, 3)'::tid <> '(3, 4)'::tid;
+ ?column? 
+----------
+ t
+(1 row)
+
index 247d6facb8ea842b96324ac0e4b3a983321ecd7e..76b22cd99cc0c7b12d02e4c6b347f6a937c613d3 100644 (file)
@@ -325,3 +325,9 @@ rollback to x;
 fetch from foo;
 
 abort;
+
+-- tests for the "tid" type
+SELECT '(3, 3)'::tid = '(3, 4)'::tid;
+SELECT '(3, 3)'::tid = '(3, 3)'::tid;
+SELECT '(3, 3)'::tid <> '(3, 3)'::tid;
+SELECT '(3, 3)'::tid <> '(3, 4)'::tid;