aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/input/create_function_1.source
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2021-04-01 11:45:22 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2021-04-01 11:45:22 +0300
commitea1b99a6619cd9dcfd46b82ac0d926b0b80e0ae9 (patch)
tree1a2c73601043edd7d6512fba51859cc860215e15 /src/test/regress/input/create_function_1.source
parente2639a767bfa1afebaf1877515a1187feb393443 (diff)
downloadpostgresql-ea1b99a6619cd9dcfd46b82ac0d926b0b80e0ae9.tar.gz
postgresql-ea1b99a6619cd9dcfd46b82ac0d926b0b80e0ae9.zip
Add 'noError' argument to encoding conversion functions.
With the 'noError' argument, you can try to convert a buffer without knowing the character boundaries beforehand. The functions now need to return the number of input bytes successfully converted. This is is a backwards-incompatible change, if you have created a custom encoding conversion with CREATE CONVERSION. This adds a check to pg_upgrade for that, refusing the upgrade if there are any user-defined encoding conversions. Custom conversions are very rare, there are no commonly used extensions that I know of that uses that feature. No other objects can depend on conversions, so if you do have one, you can fairly easily drop it before upgrading, and recreate it after the upgrade with an updated version. Add regression tests for built-in encoding conversions. This doesn't cover every conversion, but it covers all the internal functions in conv.c that are used to implement the conversions. Reviewed-by: John Naylor Discussion: https://www.postgresql.org/message-id/e7861509-3960-538a-9025-b75a61188e01%40iki.fi
Diffstat (limited to 'src/test/regress/input/create_function_1.source')
-rw-r--r--src/test/regress/input/create_function_1.source4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/regress/input/create_function_1.source b/src/test/regress/input/create_function_1.source
index 412e339fcf2..6ba37fe63b6 100644
--- a/src/test/regress/input/create_function_1.source
+++ b/src/test/regress/input/create_function_1.source
@@ -78,6 +78,10 @@ CREATE FUNCTION test_opclass_options_func(internal)
AS '@libdir@/regress@DLSUFFIX@', 'test_opclass_options_func'
LANGUAGE C;
+CREATE FUNCTION test_enc_conversion(bytea, name, name, bool, validlen OUT int, result OUT bytea)
+ AS '@libdir@/regress@DLSUFFIX@', 'test_enc_conversion'
+ LANGUAGE C;
+
-- Things that shouldn't work:
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL