Skip site navigation (1) Skip section navigation (2)

Re: User-defined typle similar to char(length) varchar(length)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: User-defined typle similar to char(length) varchar(length)
Date: 2006-07-31 13:48:56
Message-ID: 14115.1154353736@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-07-31 13:52:17
Subject: Re: Connection limit and Superuser
Previous:From: Rod TaylorDate: 2006-07-31 13:31:49
Subject: Re: Connection limit and Superuser

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group