Oddity in column specifications for table creation - Mailing list pgsql-general

From Marc Munro
Subject Oddity in column specifications for table creation
Date
Msg-id 1197402045.27581.12.camel@bloodnok.com
Whole thread Raw
Responses Re: Oddity in column specifications for table creation
List pgsql-general
It seems that in create table I cannot specify the schema of a built-in
type that has a length specifier.  Nor can I double-quote the type name.
Is this correct/expected behaviour, and are there work-arounds?

This works fine:

create table "public"."additional" (
  "str1"                "pg_catalog"."text" not null,
  "str2"                "pg_catalog"."varchar"
  );

This does not:

  create table "public"."additional" (
    "str1"                "pg_catalog"."text" not null,
    "str2"                "pg_catalog"."varchar"(40)
    );
  ERROR:  syntax error at or near "("
  LINE 3:   "str2"                "pg_catalog"."varchar"(40)

Or this:

  create table "public"."additional" (
    "str1"                "pg_catalog"."text" not null,
    "str2"                "pg_catalog".varchar(40)
    );
  ERROR:  syntax error at or near "("
  LINE 3:   "str2"                "pg_catalog".varchar(40)

Or this:

create table "public"."additional" (
  "str1"                "pg_catalog"."text" not null,
  "str2"                pg_catalog.varchar(40)
  );
ERROR:  syntax error at or near "("
LINE 3:   "str2"                pg_catalog.varchar(40)

But this does:

  create table "public"."additional" (
    "str1"                "pg_catalog"."text" not null,
    "str2"                varchar(40)
  );

For now, I will simply not quote or schema-specify anything from
pg_catalog (though I guess I should force the search path to only
include pg_catalog in this case) but I find the limitation kinda odd.

This is in 8.1 and 8.2

__
Marc

Attachment

pgsql-general by date:

Previous
From: "John D. Burger"
Date:
Subject: Re: top posting
Next
From: Thomas Hart
Date:
Subject: Re: top posting