From: Peter Eisentraut Date: Wed, 28 Dec 2016 17:00:00 +0000 (-0500) Subject: Register missing money operators in system catalogs X-Git-Tag: REL_10_BETA1~1099 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=323b96aa34239b5a8fe773d614a6ee50d731a683;p=postgresql Register missing money operators in system catalogs The operators money*int8, int8*money, and money/int8 were implemented in code but not registered in pg_operator or pg_proc. Reviewed-by: Pavel Stehule --- diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 6da1fe9340..54211f5618 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201701171 +#define CATALOG_VERSION_NO 201701172 #endif diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index aeb792703d..b1d25b5efb 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -709,6 +709,10 @@ DATA(insert OID = 908 ( "*" PGNSP PGUID b f f 790 701 790 916 0 cash_mul_ DESCR("multiply"); DATA(insert OID = 909 ( "/" PGNSP PGUID b f f 790 701 790 0 0 cash_div_flt8 - - )); DESCR("divide"); +DATA(insert OID = 3346 ( "*" PGNSP PGUID b f f 790 20 790 3349 0 cash_mul_int8 - - )); +DESCR("multiply"); +DATA(insert OID = 3347 ( "/" PGNSP PGUID b f f 790 20 790 0 0 cash_div_int8 - - )); +DESCR("divide"); DATA(insert OID = 912 ( "*" PGNSP PGUID b f f 790 23 790 917 0 cash_mul_int4 - - )); DESCR("multiply"); DATA(insert OID = 913 ( "/" PGNSP PGUID b f f 790 23 790 0 0 cash_div_int4 - - )); @@ -719,6 +723,8 @@ DATA(insert OID = 915 ( "/" PGNSP PGUID b f f 790 21 790 0 0 cash_div_ DESCR("divide"); DATA(insert OID = 916 ( "*" PGNSP PGUID b f f 701 790 790 908 0 flt8_mul_cash - - )); DESCR("multiply"); +DATA(insert OID = 3349 ( "*" PGNSP PGUID b f f 20 790 790 3346 0 int8_mul_cash - - )); +DESCR("multiply"); DATA(insert OID = 917 ( "*" PGNSP PGUID b f f 23 790 790 912 0 int4_mul_cash - - )); DESCR("multiply"); DATA(insert OID = 918 ( "*" PGNSP PGUID b f f 21 790 790 914 0 int2_mul_cash - - )); diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 7fc0e037b6..4e425e1b51 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -957,8 +957,11 @@ DESCR("name of the current database"); DATA(insert OID = 817 ( current_query PGNSP PGUID 12 1 0 0 0 f f f f f f v r 0 0 25 "" _null_ _null_ _null_ _null_ _null_ current_query _null_ _null_ _null_ )); DESCR("get the currently executing query"); +DATA(insert OID = 3343 ( int8_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "20 790" _null_ _null_ _null_ _null_ _null_ int8_mul_cash _null_ _null_ _null_ )); DATA(insert OID = 862 ( int4_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "23 790" _null_ _null_ _null_ _null_ _null_ int4_mul_cash _null_ _null_ _null_ )); DATA(insert OID = 863 ( int2_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "21 790" _null_ _null_ _null_ _null_ _null_ int2_mul_cash _null_ _null_ _null_ )); +DATA(insert OID = 3344 ( cash_mul_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 20" _null_ _null_ _null_ _null_ _null_ cash_mul_int8 _null_ _null_ _null_ )); +DATA(insert OID = 3345 ( cash_div_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 20" _null_ _null_ _null_ _null_ _null_ cash_div_int8 _null_ _null_ _null_ )); DATA(insert OID = 864 ( cash_mul_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 23" _null_ _null_ _null_ _null_ _null_ cash_mul_int4 _null_ _null_ _null_ )); DATA(insert OID = 865 ( cash_div_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 23" _null_ _null_ _null_ _null_ _null_ cash_div_int4 _null_ _null_ _null_ )); DATA(insert OID = 866 ( cash_mul_int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 21" _null_ _null_ _null_ _null_ _null_ cash_mul_int2 _null_ _null_ _null_ )); diff --git a/src/test/regress/expected/money.out b/src/test/regress/expected/money.out index a05fdd9f42..0cc69f925f 100644 --- a/src/test/regress/expected/money.out +++ b/src/test/regress/expected/money.out @@ -69,6 +69,24 @@ SELECT m / 2::int2 FROM money_data; $61.50 (1 row) +SELECT m * 2::int8 FROM money_data; + ?column? +---------- + $246.00 +(1 row) + +SELECT 2::int8 * m FROM money_data; + ?column? +---------- + $246.00 +(1 row) + +SELECT m / 2::int8 FROM money_data; + ?column? +---------- + $61.50 +(1 row) + SELECT m * 2::float8 FROM money_data; ?column? ---------- diff --git a/src/test/regress/sql/money.sql b/src/test/regress/sql/money.sql index 9e89e32d77..f5a92f2a69 100644 --- a/src/test/regress/sql/money.sql +++ b/src/test/regress/sql/money.sql @@ -16,6 +16,9 @@ SELECT m / 2 FROM money_data; SELECT m * 2::int2 FROM money_data; SELECT 2::int2 * m FROM money_data; SELECT m / 2::int2 FROM money_data; +SELECT m * 2::int8 FROM money_data; +SELECT 2::int8 * m FROM money_data; +SELECT m / 2::int8 FROM money_data; SELECT m * 2::float8 FROM money_data; SELECT 2::float8 * m FROM money_data; SELECT m / 2::float8 FROM money_data;