Re: Is it possible to return custom type as proper ROW?

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>, pgsql-general(at)postgresql(dot)org, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: Is it possible to return custom type as proper ROW?
Date: 2006-10-11 21:27:39
Message-ID: b42b73150610111427he36998dj28191e060f1963d4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/12/06, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> > assumed column ordering is the real enemy. Here is another place
> > where select * is imo better style than non select *:
> >
> > select q.*, bar from
> > (
> > select a, b,c from foo
> > ) q;
> >
>
> What is "bar"?

bar is somthing else, a constant, field from related join, or
whetever. Also, i am much more liberal about select * in views,
because the decision about columns is pushed out to the view selector:

create view foobar as
select * from foo natural join bar;

My rationale here is the major point of the view is relating foo to
bar, not choosing columns. Also, if foo/bar gain lose columns, I have
but to drop/recreate the view without changing it's definition. This
makes the view more functionally dependant on the tables.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-10-11 21:43:39 Re: strange error when inserting via a SRF into a table with a foreign key constraint
Previous Message Karsten Hilbert 2006-10-11 21:21:58 Re: Is it possible to return custom type as proper ROW?