mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Add support for file inclusions in HBA and ident configuration files
pg_hba.conf and pg_ident.conf gain support for three record keywords: - "include", to include a file. - "include_if_exists", to include a file, ignoring it if missing. - "include_dir", to include a directory of files. These are classified by name (C locale, mostly) and need to be prefixed by ".conf", hence following the same rules as GUCs. This commit relies on the refactoring pieces done inefc9816,ad6c528,783e8c6and1b73d0b, adding a small wrapper to build a list of TokenizedAuthLines (tokenize_include_file), and the code is shaped to offer some symmetry with what is done for GUCs with the same options. pg_hba_file_rules and pg_ident_file_mappings gain a new field called file_name, to track from which file a record is located, taking advantage of the addition of rule_number inc591300to offer an organized view of the HBA or ident records loaded. Bump catalog version. Author: Julien Rouhaud Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/20220223045959.35ipdsvbxcstrhya@jrouhaud
This commit is contained in:
		@@ -1002,12 +1002,21 @@
 | 
			
		||||
      </para></entry>
 | 
			
		||||
     </row>
 | 
			
		||||
 | 
			
		||||
     <row>
 | 
			
		||||
      <entry role="catalog_table_entry"><para role="column_definition">
 | 
			
		||||
       <structfield>file_name</structfield> <type>text</type>
 | 
			
		||||
      </para>
 | 
			
		||||
      <para>
 | 
			
		||||
       Name of the file containing this rule
 | 
			
		||||
      </para></entry>
 | 
			
		||||
     </row>
 | 
			
		||||
 | 
			
		||||
     <row>
 | 
			
		||||
      <entry role="catalog_table_entry"><para role="column_definition">
 | 
			
		||||
       <structfield>line_number</structfield> <type>int4</type>
 | 
			
		||||
      </para>
 | 
			
		||||
      <para>
 | 
			
		||||
       Line number of this rule in <filename>pg_hba.conf</filename>
 | 
			
		||||
       Line number of this rule in <literal>file_name</literal>
 | 
			
		||||
      </para></entry>
 | 
			
		||||
     </row>
 | 
			
		||||
 | 
			
		||||
@@ -1152,12 +1161,21 @@
 | 
			
		||||
      </para></entry>
 | 
			
		||||
     </row>
 | 
			
		||||
 | 
			
		||||
     <row>
 | 
			
		||||
      <entry role="catalog_table_entry"><para role="column_definition">
 | 
			
		||||
       <structfield>file_name</structfield> <type>text</type>
 | 
			
		||||
      </para>
 | 
			
		||||
      <para>
 | 
			
		||||
       Name of the file containing this map
 | 
			
		||||
      </para></entry>
 | 
			
		||||
     </row>
 | 
			
		||||
 | 
			
		||||
     <row>
 | 
			
		||||
      <entry role="catalog_table_entry"><para role="column_definition">
 | 
			
		||||
       <structfield>line_number</structfield> <type>int4</type>
 | 
			
		||||
      </para>
 | 
			
		||||
      <para>
 | 
			
		||||
       Line number of this map in <filename>pg_ident.conf</filename>
 | 
			
		||||
       Line number of this map in <literal>file_name</literal>
 | 
			
		||||
      </para></entry>
 | 
			
		||||
     </row>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user