tg_table_name and tg_table_schema for plpgsql

Started by Andrew Dunstanabout 20 years ago3 messagespatches
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

Here's a patch for tg_table_name and tg_table_schema for plpgsql, which
I would appreciate a quick review of just to make sure I haven't missed
something or done something silly. This will complete this exercise - I
have already committed analogous changes for plperl, plpython and pltcl.

cheers

andrew

Attachments:

schemaname.patchtext/x-patch; name=schemaname.patchDownload+220-23
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: tg_table_name and tg_table_schema for plpgsql

Andrew Dunstan <andrew@dunslane.net> writes:

Here's a patch for tg_table_name and tg_table_schema for plpgsql, which
I would appreciate a quick review of just to make sure I haven't missed
something or done something silly.

Looks all right other than odd indentation ;-)

If you want to test tg_relid, what about casting it to regclass to get a
reasonable symbolic printout?

regards, tom lane

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: tg_table_name and tg_table_schema for plpgsql

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Here's a patch for tg_table_name and tg_table_schema for plpgsql, which
I would appreciate a quick review of just to make sure I haven't missed
something or done something silly.

Looks all right other than odd indentation ;-)

Did you mean in pl_exec.c? It looks better when applied - but it's not
easy to fit that long call into 80 cols neatly. I guess if pg_indent
doesn't like it it will tidy thing up when we do a run.

If you want to test tg_relid, what about casting it to regclass to get a
reasonable symbolic printout?

Good idea - I'll do that for plpgsql where it's easier. I don't think
it's worth the trouble for the other PLs.

cheers

andrew