1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-23 03:21:12 +03:00
Files
config
contrib
adminpack
amcheck
auth_delay
auto_explain
bloom
bool_plperl
btree_gin
btree_gist
citext
cube
dblink
dict_int
dict_xsyn
earthdistance
file_fdw
fuzzystrmatch
hstore
hstore_plperl
expected
create_transform.out
hstore_plperl.out
hstore_plperlu.out
sql
.gitignore
Makefile
hstore_plperl--1.0.sql
hstore_plperl.c
hstore_plperl.control
hstore_plperlu--1.0.sql
hstore_plperlu.control
hstore_plpython
intagg
intarray
isn
jsonb_plperl
jsonb_plpython
lo
ltree
ltree_plpython
oid2name
old_snapshot
pageinspect
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm
pg_stat_statements
pg_surgery
pg_trgm
pg_visibility
pgcrypto
pgrowlocks
pgstattuple
postgres_fdw
seg
sepgsql
spi
sslinfo
start-scripts
tablefunc
tcn
test_decoding
tsm_system_rows
tsm_system_time
unaccent
uuid-ossp
vacuumlo
xml2
Makefile
README
contrib-global.mk
doc
src
.dir-locals.el
.editorconfig
.gitattributes
.gitignore
COPYRIGHT
GNUmakefile.in
HISTORY
Makefile
README
README.git
aclocal.m4
configure
configure.ac
postgres/contrib/hstore_plperl/expected/create_transform.out

76 lines
3.8 KiB
Plaintext

-- general regression test for transforms
DROP EXTENSION IF EXISTS hstore CASCADE;
NOTICE: extension "hstore" does not exist, skipping
DROP EXTENSION IF EXISTS plperl CASCADE;
NOTICE: extension "plperl" does not exist, skipping
DROP EXTENSION IF EXISTS hstore_plperl CASCADE;
NOTICE: extension "hstore_plperl" does not exist, skipping
CREATE EXTENSION hstore;
CREATE EXTENSION plperl;
CREATE FUNCTION hstore_to_plperl(val internal) RETURNS internal
LANGUAGE C STRICT IMMUTABLE
AS '$libdir/hstore_plperl';
CREATE FUNCTION plperl_to_hstore(val internal) RETURNS hstore
LANGUAGE C STRICT IMMUTABLE
AS '$libdir/hstore_plperl';
CREATE TRANSFORM FOR foo LANGUAGE plperl (FROM SQL WITH FUNCTION hstore_to_plperl(internal), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- fail
ERROR: type "foo" does not exist
CREATE TRANSFORM FOR hstore LANGUAGE foo (FROM SQL WITH FUNCTION hstore_to_plperl(internal), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- fail
ERROR: language "foo" does not exist
CREATE TRANSFORM FOR hstore LANGUAGE plperl (FROM SQL WITH FUNCTION hstore_out(hstore), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- fail
ERROR: return data type of FROM SQL function must be internal
CREATE TRANSFORM FOR hstore LANGUAGE plperl (FROM SQL WITH FUNCTION internal_in(cstring), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- fail
ERROR: first argument of transform function must be type internal
CREATE TRANSFORM FOR hstore LANGUAGE plperl (FROM SQL WITH FUNCTION hstore_to_plperl(internal), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- ok
CREATE TRANSFORM FOR hstore LANGUAGE plperl (FROM SQL WITH FUNCTION hstore_to_plperl(internal), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- fail
ERROR: transform for type hstore language "plperl" already exists
CREATE OR REPLACE TRANSFORM FOR hstore LANGUAGE plperl (FROM SQL WITH FUNCTION hstore_to_plperl(internal), TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- ok
CREATE OR REPLACE TRANSFORM FOR hstore LANGUAGE plperl (FROM SQL WITH FUNCTION hstore_to_plperl(internal)); -- ok
CREATE OR REPLACE TRANSFORM FOR hstore LANGUAGE plperl (TO SQL WITH FUNCTION plperl_to_hstore(internal)); -- ok
COMMENT ON TRANSFORM FOR hstore LANGUAGE plperl IS 'test';
DROP TRANSFORM IF EXISTS FOR fake_type LANGUAGE plperl;
NOTICE: type "fake_type" does not exist, skipping
DROP TRANSFORM IF EXISTS FOR hstore LANGUAGE fake_lang;
NOTICE: transform for type hstore language "fake_lang" does not exist, skipping
DROP TRANSFORM FOR foo LANGUAGE plperl;
ERROR: type "foo" does not exist
DROP TRANSFORM FOR hstore LANGUAGE foo;
ERROR: language "foo" does not exist
DROP TRANSFORM FOR hstore LANGUAGE plperl;
DROP TRANSFORM IF EXISTS FOR hstore LANGUAGE plperl;
NOTICE: transform for type hstore language "plperl" does not exist, skipping
DROP FUNCTION hstore_to_plperl(val internal);
DROP FUNCTION plperl_to_hstore(val internal);
CREATE EXTENSION hstore_plperl;
\dx+ hstore_plperl
Objects in extension "hstore_plperl"
Object description
--------------------------------------
function hstore_to_plperl(internal)
function plperl_to_hstore(internal)
transform for hstore language plperl
(3 rows)
ALTER EXTENSION hstore_plperl DROP TRANSFORM FOR hstore LANGUAGE plperl;
\dx+ hstore_plperl
Objects in extension "hstore_plperl"
Object description
-------------------------------------
function hstore_to_plperl(internal)
function plperl_to_hstore(internal)
(2 rows)
ALTER EXTENSION hstore_plperl ADD TRANSFORM FOR hstore LANGUAGE plperl;
\dx+ hstore_plperl
Objects in extension "hstore_plperl"
Object description
--------------------------------------
function hstore_to_plperl(internal)
function plperl_to_hstore(internal)
transform for hstore language plperl
(3 rows)
DROP EXTENSION hstore CASCADE;
NOTICE: drop cascades to extension hstore_plperl
DROP EXTENSION plperl CASCADE;