Re: Another quick question...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Another quick question...
Date: 2002-08-01 04:26:33
Message-ID: 4375.1028175993@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> If you have RelationGetRelationName(rel) to get the name of a relation, how
> do you get it's fully qualified schema name? Or how do I get the schema
> name for the relation?

Well, you can do get_namespace_name(rel->rd_rel->relnamespace), but
I don't really agree with changing error messages to *always* quote
the schema name. I think that'd be overly verbose. An appropriate
solution is to mention the schema name only when it's necessary to
identify the relation (ie, the rel would not be found in your current
search path).

generate_relation_name() in backend/utils/adt/ruleutils.c illustrates
how to do this. Maybe that code ought to be promoted into some more
widely useful location. See also the recently added format_procedure()
and format_operator() in regproc.c.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Deasey 2002-08-01 04:42:17 Re: Open 7.3 items
Previous Message Curt Sampson 2002-08-01 04:17:07 Re: Rules and Views