Re: quote_ident and schemas (was Re: connectby with schema) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: quote_ident and schemas (was Re: connectby with schema)
Date
Msg-id 26212.1037992534@sss.pgh.pa.us
Whole thread Raw
In response to Re: quote_ident and schemas (was Re: connectby with schema)  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Joe Conway <mail@joeconway.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


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: quote_ident and schemas (was Re: connectby with schema)
Next
From: Justin Clift
Date:
Subject: Interesting thought from an article about Sun technologies