Re: Accessing fields past CATALOG_VARLEN

Chapman Flack <chap@anastigmatix.net>

From: Chapman Flack <chap@anastigmatix.net>
To: Ed Behn <ed@behn.us>, pgsql-hackers@postgresql.org
Date: 2022-01-03T22:32:56Z
Lists: pgsql-hackers
On 01/03/22 17:23, Ed Behn wrote:
> However, I get a compiler error when I try to access procStruct->proargmodes.
> I know that this is because this field is in the CATALOG_VARLEN block which
> makes it invisible to the compiler.
> 
> What is the proper way to get this field?

You can use SysCacheGetAttr with the attribute number. It knows all the
magic needed to find the right offset, possibly decompress, etc.

Regards,
-Chap