Re: SQL99, CREATE CAST, and initdb

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL99, CREATE CAST, and initdb
Date: 2002-06-25 00:16:46
Message-ID: 3D17B66E.D33AAA3B@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I see no real reason why we should not require casting functions to
> follow the Postgres naming convention --- after all, what else would
> you name a casting function?

We do require casting functions to follow the Postgres naming
convention. istm to be a waste of time to have the CREATE CAST() feature
*only* set a bit on an existing function, especially given the SQL99
syntax which implies that it can define a cast operation for an
arbitrarily named function. It also supposes that the only allowed casts
are *implicit casts* (see below for a new issue) which is not quite
right. I've defined alternate forms which draw on the general PostgreSQL
feature set and capabilities, but if we can fit the SQL99 model then we
should go ahead and do that too.

I've got another issue with casting which I've run into while testing
this feature; afaict invoking an explicit CAST() in SQL does not
guarantee that the function of the expected name would be called, if
that function does not have the implicit flag set. Seems that it should
be willing to do the conversion even if the function is not marked as
allowing implicit casts; after all, this is an *explicit* cast!

I'm pretty sure that this is the behavior I've been seeing, but will
publish a test case to confirm it when I have a chance.

- Thomas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message J. R. Nield 2002-06-25 00:28:00 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Hiroshi Inoue 2002-06-24 23:51:41 Re: [HACKERS] ODBC Driver 7.02.0001 (Win32) (Unicode mode): CRLF->LF