Re: Accessing fields past CATALOG_VARLEN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ed Behn <ed(at)behn(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Accessing fields past CATALOG_VARLEN
Date: 2022-01-03 22:35:33
Message-ID: 3915193.1641249333@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ed Behn <ed(at)behn(dot)us> writes:
> I can get fields like procStruct->prokind and procStruct->proretset.
> 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?

SysCacheGetAttr(). There are examples all over the tree, but
one that's specific to proargmodes (and also illustrates the
best practices for deciphering its value) is in
parser/analyze.c's transformCallStmt().

You should also ask yourself if you really *need* to examine
proargmodes for yourself, or if there's a utility function
somewhere that will compute what you need to know.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-01-03 23:15:10 Re: Bug fix for tab completion of ALTER TABLE ... VALIDATE CONSTRAINT ...
Previous Message Chapman Flack 2022-01-03 22:32:56 Re: Accessing fields past CATALOG_VARLEN