mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	On some platforms, plperl and plperlu cannot be loaded at the same time. So split the test into two separate test files.
		
			
				
	
	
		
			44 lines
		
	
	
		
			881 B
		
	
	
	
		
			PL/PgSQL
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			881 B
		
	
	
	
		
			PL/PgSQL
		
	
	
	
	
	
CREATE EXTENSION hstore;
 | 
						|
CREATE EXTENSION plperl;
 | 
						|
CREATE EXTENSION hstore_plperl;
 | 
						|
 | 
						|
SELECT transforms.udt_schema, transforms.udt_name,
 | 
						|
       routine_schema, routine_name,
 | 
						|
       group_name, transform_type
 | 
						|
FROM information_schema.transforms JOIN information_schema.routines
 | 
						|
     USING (specific_catalog, specific_schema, specific_name)
 | 
						|
ORDER BY 1, 2, 5, 6;
 | 
						|
 | 
						|
 | 
						|
-- test perl -> hstore
 | 
						|
CREATE FUNCTION test2() RETURNS hstore
 | 
						|
LANGUAGE plperl
 | 
						|
TRANSFORM FOR TYPE hstore
 | 
						|
AS $$
 | 
						|
$val = {a => 1, b => 'boo', c => undef};
 | 
						|
return $val;
 | 
						|
$$;
 | 
						|
 | 
						|
SELECT test2();
 | 
						|
 | 
						|
 | 
						|
-- test perl -> hstore[]
 | 
						|
CREATE FUNCTION test2arr() RETURNS hstore[]
 | 
						|
LANGUAGE plperl
 | 
						|
TRANSFORM FOR TYPE hstore
 | 
						|
AS $$
 | 
						|
$val = [{a => 1, b => 'boo', c => undef}, {d => 2}];
 | 
						|
return $val;
 | 
						|
$$;
 | 
						|
 | 
						|
SELECT test2arr();
 | 
						|
 | 
						|
 | 
						|
DROP FUNCTION test2();
 | 
						|
DROP FUNCTION test2arr();
 | 
						|
 | 
						|
 | 
						|
DROP EXTENSION hstore_plperl;
 | 
						|
DROP EXTENSION hstore;
 | 
						|
DROP EXTENSION plperl;
 |