Re: CREATE SCHEMA ... CREATE DOMAIN support - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CREATE SCHEMA ... CREATE DOMAIN support
Date
Msg-id 1645311.1733158576@sss.pgh.pa.us
Whole thread Raw
In response to Re: CREATE SCHEMA ... CREATE DOMAIN support  (Vik Fearing <vik@postgresfriends.org>)
Responses Re: CREATE SCHEMA ... CREATE DOMAIN support
List pgsql-hackers
Vik Fearing <vik@postgresfriends.org> writes:
> On 02/12/2024 03:15, Tom Lane wrote:
>> Also, if SQL intended to constrain the search path for unqualified
>> identifiers to be only the new schema, they'd hardly need a concept
>> of <schema path specification> at all.

> I looked up the original paper (MUN-051) that introduced the <schema 
> path specification> and it says, "The paper is proposing the use of 
> paths only to resolve unqualified routine invocations."

Interesting.  But still, the spec allows <schema routine> within
<schema definition>, so even that narrow interpretation opens them
to the is-this-an-external-reference-or-a-forward-reference problem.

For us, that's clouded further for functions by our overloading rules.
If foo(bigint) exists in the search path, and we have a view or
whatever that references foo() with an int argument, and there is a
CREATE FUNCTION for foo(float8) later in the <schema definition>, what
are we supposed to think is the user's intent?  (Just to save people
doing the experiment: we'd prefer foo(float8) if both are visible,
but foo(bigint) would be perfectly acceptable if not.  Other choices
of the argument types would yield different results, and none of them
seem especially open-and-shut to me.)  I don't know offhand if the
spec allows function overloading in the same way.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Incorrect result of bitmap heap scan.
Next
From: Nathan Bossart
Date:
Subject: Re: Proposal for Updating CRC32C with AVX-512 Algorithm.