Re: PostGreSQL and recursive queries...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostGreSQL and recursive queries...
Date: 2007-12-01 04:37:04
Message-ID: 11296.1196483824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sam Mason <sam(at)samason(dot)me(dot)uk> writes:
> Sounds as though you need some sort of type inference algorithm. There
> are quite a few decidable ones around, the one by Hindley-Milner being
> very popular/common. Decidable means you get the correct answer out in
> a reasonable amount of time or it fails, and, barring implementation
> bugs, it'll never get stuck trying to figure out what you meant.

I think some closer reading of the SQL spec might be called for.
I'm pretty sure the spec authors did not intend to require any
especially abstruse algorithm to infer the types involved in a recursive
query. In fact, if they have not completely abandoned their duty as
spec writers, the spec itself should spell out any algorithms required
to determine the meaning of a query. (As distinct from algorithms
needed to produce an efficient implementation, which is a topic outside
the purview of the spec. But "what type is this result column" is
surely something the spec is required to define.)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2007-12-01 06:12:09 compiling postgres in winxp
Previous Message Greg Smith 2007-12-01 00:04:28 Re: 8.3 beta testing suggestions welcome