On 10/18/25 06:08, Philip Alger wrote:
>
> Yes, you're correct. I've added that in v6 attached.
Nice. The code now checks res for NULL, which aligns with other similar
functions, e.g. pg_get_indexdef.
if (res == NULL)
PG_RETURN_NULL();
One nitpick:
You're probably initialising the buffer a bit too early:
...
/* Validate that the relation exists */
if (!OidIsValid(relid) || get_rel_name(relid) == NULL)
PG_RETURN_NULL();
initStringInfo(&buf);
...
If the function is going to return NULL, there is no need to allocate
memory for buf. I guess you could place it right before the
appendStringInfo call:
initStringInfo(&buf);
appendStringInfo(&buf, "%s;", res);
Other than that, the patch LGTM. If the other reviewers have no
objections, I'll mark it as ready for committer.
Thanks for the patch.
Best, Jim