mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	even when a single relation requires more than max_fsm_pages pages. Also, make VACUUM emit a warning in this case, since it likely means that VACUUM FULL or other drastic corrective measure is needed. Per reports from Jeff Frost and others of unexpected changes in the claimed max_fsm_pages need.
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			MySQL
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			MySQL
		
	
	
	
	
	
| -- Adjust this setting to control where the objects get created.
 | |
| BEGIN;
 | |
| SET search_path = public;
 | |
| 
 | |
| 
 | |
| -- Register the functions.
 | |
| CREATE OR REPLACE FUNCTION pg_freespacemap_pages()
 | |
| RETURNS SETOF RECORD
 | |
| AS 'MODULE_PATHNAME', 'pg_freespacemap_pages'
 | |
| LANGUAGE C;
 | |
| 
 | |
| CREATE OR REPLACE FUNCTION pg_freespacemap_relations()
 | |
| RETURNS SETOF RECORD
 | |
| AS 'MODULE_PATHNAME', 'pg_freespacemap_relations'
 | |
| LANGUAGE C;
 | |
| 
 | |
| 
 | |
| -- Create views for convenient access.
 | |
| CREATE VIEW pg_freespacemap_pages AS
 | |
| 	SELECT P.* FROM pg_freespacemap_pages() AS P
 | |
| 	(reltablespace oid,
 | |
| 	 reldatabase oid,
 | |
| 	 relfilenode oid,
 | |
| 	 relblocknumber bigint,
 | |
| 	 bytes integer);
 | |
|  
 | |
| CREATE VIEW pg_freespacemap_relations AS
 | |
| 	SELECT P.* FROM pg_freespacemap_relations() AS P
 | |
| 	(reltablespace oid,
 | |
| 	 reldatabase oid,
 | |
| 	 relfilenode oid,
 | |
| 	 avgrequest integer,
 | |
| 	 interestingpages integer,
 | |
| 	 storedpages integer,
 | |
| 	 nextpage integer);
 | |
| 
 | |
|  
 | |
| -- Don't want these to be available to public.
 | |
| REVOKE ALL ON FUNCTION pg_freespacemap_pages() FROM PUBLIC;
 | |
| REVOKE ALL ON pg_freespacemap_pages FROM PUBLIC;
 | |
| 
 | |
| REVOKE ALL ON FUNCTION pg_freespacemap_relations() FROM PUBLIC;
 | |
| REVOKE ALL ON pg_freespacemap_relations FROM PUBLIC;
 | |
| 
 | |
| COMMIT;
 |