On Aug 27, 2007, at 11:47 , Tony Caduto wrote:
Good call on the name limit, I remember running into that when
porting something from MS SQL server to Firebird about 4 years ago.
Just a quick note: PostgreSQL's identifiers are limited to
NAMEDATALEN - 1 (IIRC), which by default is 64 - 1 = 63 characters:
test=# create table a
(a23456789112345678921234567893123456789412345678951234567896123 text
primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"a_pkey" for table "a"
CREATE TABLE
test=# create table b
(a234567891123456789212345678931234567894123456789512345678961234
text primary key);
NOTICE: identifier
"a234567891123456789212345678931234567894123456789512345678961234"
will be truncated to
"a23456789112345678921234567893123456789412345678951234567896123"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"b_pkey" for table "b"
CREATE TABLE
The upshot is that PostgreSQL does have a limit, but it's pretty big
initially and is configurable at compilation by changing the
definition of NAMEDATALEN in in src/include/postgres_ext.h.
Michael Glaesemann
grzm seespotcode net
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match