Re: generate syscache info automatically

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-05-31T21:24:01Z
Lists: pgsql-hackers
On 31.05.23 13:02, Dagfinn Ilmari Mannsåker wrote:
> For other patterns without the optional bits in the keyword, it becomes
> even simpler, e.g.
> 
> 		if (/^DECLARE_TOAST\(\s*
> 			 (?<parent_table>\w+),\s*
> 			 (?<toast_oid>\d+),\s*
> 			 (?<toast_index_oid>\d+)\s*
> 			 \)/x
> 		  )
> 		{
> 			push @{ $catalog{toasting} }, {%+};
> 	   	}
> 
> 
> I'd be happy to submit a patch to do this for all the ParseHeader()
> regexes (in a separate thread) if others agree this is an improvement.

I would welcome such a patch.




Commits

  1. Generate syscache info from catalog files

  2. Fill in more of ObjectProperty

  3. Correct ObjectProperty entry for transforms

  4. genbki.pl: Factor out boilerplate generation

  5. Restructure DECLARE_INDEX arguments

  6. Update DECLARE_INDEX documentation

  7. Replace hardcoded switch in object_exists() with a lookup table.