Re: postgres question: Views with duplicate field names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Murphy <ryanfmurphy(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres question: Views with duplicate field names
Date: 2016-09-05 21:25:58
Message-ID: 25224.1473110758@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ryan Murphy <ryanfmurphy(at)gmail(dot)com> writes:
> Interesting, thanks! Do you know why the first one fails instead of doing
> that renaming process, while your version succeeds?

You're confused about the input vs. the output. The output columns
of a view all have to have distinct names, just like you can't do
"create table foo (f1 int, f1 int)". They can be reading the same
values, though.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ryan Murphy 2016-09-05 21:28:51 Re: postgres question: Views with duplicate field names
Previous Message Patrick B 2016-09-05 21:13:05 Re: Get date timestamp(3) without time zone column - PGSQL 9.5