Re: too many dotted names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vladimir Kokovic <vladimir(dot)kokovic(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: too many dotted names
Date: 2011-04-07 07:08:18
Message-ID: 7064.1302160098@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vladimir Kokovic <vladimir(dot)kokovic(at)gmail(dot)com> writes:
> On 4/7/11, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Wed, Apr 6, 2011 at 4:23 PM, Vladimir Kokovic
>> <vladimir(dot)kokovic(at)gmail(dot)com> wrote:
>>> ALTER TABLE "s'd"".s'd"""."s's'd""." ADD COLUMN id bigint DEFAULT
>>> nextval('"s''d".s''d""."s''d".d"s''"');
>>> ERROR: improper relation name (too many dotted names): s'd.s'd"".s'd.d"s'"

>> Treat them as what?

> Even nextval('"s''d".s''d""."s''d".d"s''"') is correct literal,

Really? According to whom? This works for me:

regression=# create schema "s'd"".s'd""";
CREATE SCHEMA
regression=# create table "s'd"".s'd"""."s's'd""." (f1 int);
CREATE TABLE
regression=# create sequence "s'd"".s'd"""."s's'd"".s" ;
CREATE SEQUENCE
regression=# ALTER TABLE "s'd"".s'd"""."s's'd""." ADD COLUMN id bigint DEFAULT nextval('"s''d"".s''d"""."s''s''d"".s"');
ALTER TABLE

I think you've made up some theory about how to quote funny characters
in nextval's argument, and it's a wrong theory. You have to double
single quotes because you're writing a string literal, but other than
that it should look just like a quoted identifier in SQL.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alastair Turner 2011-04-07 07:48:36 Re: superusers are members of all roles?
Previous Message Brendan Jurd 2011-04-07 07:07:55 Re: Failed assert ((data - start) == data_size) in heaptuple.c