On Sun, Dec 01, 2024 at 05:30:20PM -0500, Tom Lane wrote: > Which certainly begs the question of how smart their re-ordering > algorithm is, or what they do about ambiguity between new and existing > objects.
Perhaps because they are able to track efficiently all schema references, like checking the internal of functions at creation time rather than just at runtime? The ambiguity between new and existing objects may be tricky, indeed. If I'm parsing the spec right, the doc mentions in its 5)~6) of the syntax rules in CREATE SCHEMA that non-schema-qualified objects should use the new schema name defined in the CREATE SCHEMA query. So that pretty much settles the rules to use when having a new object that has a reference to a non-qualified object created in the same CREATE SCHEMA query? > But at any rate, it looks like everybody is at least trying > to do some amount of re-ordering, which makes me wonder what it is > that I'm missing in the spec. That's an awful lot of effort to be > expending on something that the spec doesn't seem to require. As Jian has mentioned, 9075-2-2023 around 11.1 for CREATE SCHEMA does not include any ordering assumptions when the elements are created, so my guess is that this is left up to each implementation depending on how they need to handle their dependencies with their meta-data lookup? The result would be the same once the query has finished running, as long as the elements created are consistent with their inner dependencies. -- Michael
signature.asc
Description: PGP signature