Re: Regclass and quoted table names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <stark(at)enterprisedb(dot)com>
Cc: Emmanuel Cecchet <manu(at)asterdata(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regclass and quoted table names
Date: 2009-03-04 14:41:29
Message-ID: 877.1236177689@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <stark(at)enterprisedb(dot)com> writes:
> On Wed, Mar 4, 2009 at 12:34 PM, Emmanuel Cecchet <manu(at)asterdata(dot)com> wrote:
>> This is problematic in situations where the output of the cast is involved
>> in some later join which returns incorrect results because of the extra
>> double quotes surrounding the table name. Is there a way to override the
>> default behavior to have a consistent quoted or non-quoted result?

> regclass's output format is intended for human readers, not for
> joining against text columns. Why would you need to be joining between
> regclass and text anyways?

The quoting behavior is the *least* of your problems if you're trying to
do that. Are you aware of how it works vis-a-vis search_path? Have you
thought about what will happen when you rename a table?

Use plain oids or regclass values, not a text column, if you are trying
to store table identities.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-03-04 14:46:31 Re: building pg_dump doesn't work
Previous Message Joshua Tolley 2009-03-04 14:34:54 SYNONYMs revisited