Re: User-defined typle similar to char(length) varchar(length) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: User-defined typle similar to char(length) varchar(length)
Date
Msg-id 14115.1154353736@sss.pgh.pa.us
Whole thread Raw
In response to Re: User-defined typle similar to char(length) varchar(length)  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: User-defined typle similar to char(length) varchar(length)  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> No. Search the archives for discussions about "user defined typmod".
> The basic problem came down too that the set of allowed words for
> functions and types would be forced to be the same (due to restrictions
> in lookahead), and people wern't happy with that because if may hamper
> future SQL compatability. There were ways around this (all fairly ugly
> though).

I seem to remember that someone had come up with an idea that might
allow it to work, but no one pushed it as far as coming up with a patch.
It's definitely the grammar that is the problem though, specifically
constructs like
char(42) 'literal value here'

If you don't treat the names of these types as reserved, it is darn hard
to tell that you're not looking at a function call until you get to the
right paren and see a string literal as lookahead ... and postponing the
parse decision that long is painful.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: Connection limit and Superuser
Next
From: Tom Lane
Date:
Subject: Re: Connection limit and Superuser