Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause
Дата
Msg-id CAApHDvpULAMZ8JKX1zz12gqtXhCi+r9178pGq4C0ODjK9ZFvtA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause  (PALAYRET Jacques <jacques.palayret@meteo.fr>)
Список pgsql-general
On Wed, 23 Mar 2022 at 04:03, PALAYRET Jacques
<jacques.palayret@meteo.fr> wrote:
> For example, in Oracle it is not possible to have a SELECT statement without a FROM clause (using DUAL table), so
maybe" ambiguous " columns are not handled in the same way.
 

But if your original complaint, the column was not ambiguous. The CTE
had no column named "id".

I really highly recommend that you write queries giving each relation
a short alias then make a habit to always prefix your column names
with the alias.  If you don't do this then you can have all sorts of
problems when you one day want to start dropping old unused columns
out of your tables.  If you alias these then dropping the columns will
properly cause queries that reference these columns to ERROR.  Without
aliases, your queries might just start doing something you don't want
them to do and you might not realise that for a very long time.

David



В списке pgsql-general по дате отправления:

Предыдущее
От: PALAYRET Jacques
Дата:
Сообщение: Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Can you install/run postgresql on a FIPS enabled host?