"Brett W. McCoy" <bmccoy(at)chapelperilous(dot)net> writes:
> I'd go with text. It's not SQL92, though.
> varchar is technically supposed to have a limit of 255,
Certainly not; the spec says
The maximum value of <length> is implementation-defined.
There may be implementations that are lame enough to limit it to 255,
but Postgres isn't one of them. IIRC, we set a rather arbitrary upper
limit of 10000000 on the length (mainly on the theory that anything
larger is either a typo, or you really don't want a limit at all, in
which case you oughta be using text).
At least in 7.2, it also works to say just "varchar" with no length
limit; this is functionally equivalent to "text" except perhaps for
some corner cases involving ambiguous-data-type resolution. But
this is not SQL-spec-compliant either.
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Brett W. McCoy||Date: 2002-02-12 22:44:41|
|Subject: Re: varchar vs char vs text |
|Previous:||From: Josh Berkus||Date: 2002-02-12 21:43:10|
|Subject: Re: "Hot Backups" |