[postgis-users] parametrized domains
Paul Ramsey
pramsey at refractions.net
Fri Apr 29 10:41:29 PDT 2005
How about something that allows us to parameterize the type after it is
declared in the statement, as with the PRIMARY KEY, DEFAULT, etc, notations:
CREATE TABLE mygeotable (
id SERIAL PRIMARY KEY,
geom GEOMETRY NOT NULL PARAMETERS(4326,2),
inserted TIMESTAMP DEFAULT NOW()
);
P.
Tom Lane wrote:
> strk at refractions.net writes:
>
>>The most elegant solution would be to specify that at table
>>creation time. Something you already use with 'varchar' - for
>>example:
>
>
>> CREATE TABLE test ( a varchar(10); )
>
>
>> CREATE TABLE test ( geom geometry(4326); )
>
>
>>We asked Tom Lane about this, but he saied the parser were
>>not ready for this kind of extensibility. I cc him so if
>>he have news will let us know.
>
>
> It's still not :-(. Only datatypes that are hard-wired into the grammar
> can have parameters. My recollection is that this looks extremely
> difficult to change, because "foo(n)" looks far too much like a function
> call if foo is not a keyword known in advance to the grammar. We'd
> probably have to adopt some other notation instead.
>
> regards, tom lane
More information about the postgis-users
mailing list