Re: quote_ident and schemas (was Re: connectby with schema)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
Subject: Re: quote_ident and schemas (was Re: connectby with schema)
Date: 2002-11-22 19:15:34
Message-ID: 26212.1037992534@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)com> writes:
> Joe Conway wrote:
>> Is quote_ident_required incorrectly dealing with schemas?

> Sorry to reply to myself, but another related question; shouldn't the
> following produce "Ms"."Test"?

> test=# select quote_ident('Ms.Test');
> quote_ident
> -------------
> "Ms.Test"
> (1 row)

No, it should not. If it did, it would fail to cope with tablenames
containing dots.

Since connectby takes a string parameter (correct?) for the table name,
my advice would be to have it not do quote_ident, but instead expect the
user to include double quotes in the string value if dealing with
mixed-case names. Compare the behavior of nextval() for example:

regression=# select nextval('Foo.Bar');
ERROR: Namespace "foo" does not exist
regression=# select nextval('"Foo"."Bar"');
ERROR: Namespace "Foo" does not exist
regression=# select nextval('"Foo.Bar"');
ERROR: Relation "Foo.Bar" does not exist

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Clift 2002-11-22 20:02:44 Interesting thought from an article about Sun technologies
Previous Message Stephan Szabo 2002-11-22 19:10:24 Re: quote_ident and schemas (was Re: connectby with schema)

Browse pgsql-patches by date

  From Date Subject
Next Message Fernando Nasser 2002-11-22 19:25:24 JDBC More SQLStatus for connections
Previous Message Stephan Szabo 2002-11-22 19:10:24 Re: quote_ident and schemas (was Re: connectby with schema)