Hi,

Does it make sense to treat these ?

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'"
SQL state: 42601

PostgreSQL 9.1devel on i686-pc-linux-gnu, compiled by GCC gcc
(Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1, 32-bit

Best regards,
Vladimir Kokovic, DP senior, Belgrade, Serbia

Search Discussions

  • Robert Haas at Apr 7, 2011 at 4:12 am

    On Wed, Apr 6, 2011 at 4:23 PM, Vladimir Kokovic wrote:
    Hi,

    Does it make sense to treat these ?

    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'"
    SQL state: 42601
    Treat them as what?

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
  • Vladimir Kokovic at Apr 7, 2011 at 6:44 am

    On 4/7/11, Robert Haas wrote:
    On Wed, Apr 6, 2011 at 4:23 PM, Vladimir Kokovic
    wrote:
    Hi,

    Does it make sense to treat these ?

    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'"
    SQL state: 42601
    Treat them as what?
    Even nextval('"s''d".s''d""."s''d".d"s''"') is correct literal,
    PostgreSQL parser treats them like error.

    I think that only solution is to prohibit ". (double quote and dot) to
    be part of schema or sequence name.

    Best regards,
    Vladimir Kokovic, DP senior, Belgrade, Serbia
  • Tom Lane at Apr 7, 2011 at 7:08 am

    Vladimir Kokovic writes:
    On 4/7/11, Robert Haas wrote:
    On Wed, Apr 6, 2011 at 4:23 PM, Vladimir Kokovic
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedApr 6, '11 at 8:23p
activeApr 7, '11 at 7:08a
posts4
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase