mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	Without CASCADE, if an extension has an unfullfilled dependency on another extension, CREATE EXTENSION ERRORs out with "required extension ... is not installed". That is annoying, especially when that dependency is an implementation detail of the extension, rather than something the extension's user can make sense of. In addition to CASCADE this also includes a small set of regression tests around CREATE EXTENSION. Author: Petr Jelinek, editorialized by Michael Paquier, Andres Freund Reviewed-By: Michael Paquier, Andres Freund, Jeff Janes Discussion: 557E0520.3040800@2ndquadrant.com
		
			
				
	
	
		
			42 lines
		
	
	
		
			839 B
		
	
	
	
		
			PL/PgSQL
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			839 B
		
	
	
	
		
			PL/PgSQL
		
	
	
	
	
	
| CREATE EXTENSION hstore_plperl CASCADE;
 | |
| 
 | |
| 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;
 |