Re: postgres question: Views with duplicate field names - Mailing list pgsql-general

From Tom Lane
Subject Re: postgres question: Views with duplicate field names
Date
Msg-id 25224.1473110758@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgres question: Views with duplicate field names  (Ryan Murphy <ryanfmurphy@gmail.com>)
Responses Re: postgres question: Views with duplicate field names  (Ryan Murphy <ryanfmurphy@gmail.com>)
Re: postgres question: Views with duplicate field names  (Ryan Murphy <ryanfmurphy@gmail.com>)
List pgsql-general
Ryan Murphy <ryanfmurphy@gmail.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


pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Re: Get date timestamp(3) without time zone column - PGSQL 9.5
Next
From: Ryan Murphy
Date:
Subject: Re: postgres question: Views with duplicate field names