mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-04 00:02:52 -05:00 
			
		
		
		
	This provides a mechanism for specifying conversions between SQL data types and procedural languages. As examples, there are transforms for hstore and ltree for PL/Perl and PL/Python. reviews by Pavel Stěhule and Andres Freund
		
			
				
	
	
		
			18 lines
		
	
	
		
			481 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			481 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
-- make sure the prerequisite libraries are loaded
 | 
						|
DO '' LANGUAGE plperl;
 | 
						|
SELECT NULL::hstore;
 | 
						|
 | 
						|
 | 
						|
CREATE FUNCTION hstore_to_plperl(val internal) RETURNS internal
 | 
						|
LANGUAGE C STRICT IMMUTABLE
 | 
						|
AS 'MODULE_PATHNAME';
 | 
						|
 | 
						|
CREATE FUNCTION plperl_to_hstore(val internal) RETURNS hstore
 | 
						|
LANGUAGE C STRICT IMMUTABLE
 | 
						|
AS 'MODULE_PATHNAME';
 | 
						|
 | 
						|
CREATE TRANSFORM FOR hstore LANGUAGE plperl (
 | 
						|
    FROM SQL WITH FUNCTION hstore_to_plperl(internal),
 | 
						|
    TO SQL WITH FUNCTION plperl_to_hstore(internal)
 | 
						|
);
 |