On 5 Sep., 19:55, Thomas Kellerer <OTPXDAJCS... (AT) spammotel (DOT) com> wrote:
Quote:
Karsten Wutzke wrote on 05.09.2009 19:36:
Hi, I'm not using PostgreSQL yet. I just wanted to know if INTEGER(n),
like INTEGER(11) or such are allowed by PostgreSQL.
No, it's not allowed. What should this mean anyway?
The datatype INTEGER already implies a specific range, so it does not make any sense at all to change this range by supplying an additional argument.
If you want a different range for a "whole number" you need to choose a different data type.
More details are here:http://www.postgresql.org/docs/curre...numeric.html#D...
Does the value in parentheses cause an error
Yes.
Postgres does not try to guess what you might have meant when an error in the SQL is detected.
Thomas |
Great answer. Thanks! I was asking because MySQL allows INTEGER(n). If
you're interested to know, even if it doesn't make sense, it's only a
spacefill, visual length, e.g. for the command line client or as
queryable meta data. Whatever. ;-)
Karsten