Search Postgresql Archives

Oddity in column specifications for table creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux