Re: [HACKERS] Make subquery alias optional in FROM clause

Поиск
Список
Период
Сортировка
Искать
От
Nico Williams
Тема
Re: [HACKERS] Make subquery alias optional in FROM clause
Дата
Msg-id
20170223163019.GC30233@localhost
Ответ на
Список
Дерево обсуждения
[HACKERS] Make subquery alias optional in FROM clause Bernd Helmle <mailings@oopsware.de>
Re: [HACKERS] Make subquery alias optional in FROM clause Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Make subquery alias optional in FROM clause Bernd Helmle <mailings@oopsware.de>
Re: [HACKERS] Make subquery alias optional in FROM clause Nico Williams <nico@cryptonector.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Make subquery alias optional in FROM clause Bernd Helmle <mailings@oopsware.de>
Re: [HACKERS] Make subquery alias optional in FROM clause Nico Williams <nico@cryptonector.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Make subquery alias optional in FROM clause Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Craig Ringer <craig@2ndquadrant.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Make subquery alias optional in FROM clause Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Pantelis Theodosiou <ypercube@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Matthew Woodcraft <matthew@woodcraft.me.uk>
Re: [HACKERS] Make subquery alias optional in FROM clause Andres Freund <andres@anarazel.de>
Re: [HACKERS] Make subquery alias optional in FROM clause "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Bernd Helmle <mailings@oopsware.de>
Re: [HACKERS] Make subquery alias optional in FROM clause "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Greg Stark <stark@mit.edu>
Re: [HACKERS] Make subquery alias optional in FROM clause Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Make subquery alias optional in FROM clause David Fetter <david@fetter.org>
Re: [HACKERS] Make subquery alias optional in FROM clause "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Make subquery alias optional in FROM clause Greg Stark <stark@mit.edu>
On Thu, Feb 23, 2017 at 10:37:16AM +0100, Bernd Helmle wrote:
> Am Mittwoch, den 22.02.2017, 22:17 -0500 schrieb Tom Lane:
> > [ shrug... ]  Well, I won't resist this hard as long as it's done
> > competently, which to me means "the subquery name doesn't conflict
> > with
> > anything else".  Not "it doesn't conflict unless you're unlucky
> > enough
> > to have used the same name elsewhere".  There are a couple ways we
> > could
> > achieve that result, but the submitted patch fails to.
> 
> Right, i'm going to give it a try then. Currently i see these options:
> 
> * Validate any generated alias against a list of explicit alias names.
> 
> This means we have to collect explicit alias names in, say a hashtable,
> and validate a generated name against potential collisions and retry.
> Or better, generate the name in a way that doesn't produce a collision
> with this list.

There's another option:
* Gensym an alias name, and if the compilation fails with that alias  name as a conflict, try again with a new gensym'ed name.

> * Don't force/generate an alias at all.

That seems like a lot of work.

Nico
-- 


В списке pgsql-hackers по дате отправления
От: Simon Riggs
Дата:
От: Masahiko Sawada
Дата:
FAQ