Re: COPY view - Mailing list pgsql-patches

From Jim C. Nasby
Subject Re: COPY view
Date
Msg-id 20060614222604.GT34196@pervasive.com
Whole thread Raw
In response to Re: COPY view  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
On Wed, Jun 14, 2006 at 05:36:25PM -0400, Bruce Momjian wrote:
> Jim C. Nasby wrote:
> > On Wed, Jun 14, 2006 at 05:19:44PM -0400, Bruce Momjian wrote:
> > > Hans-Juergen Schoenig wrote:
> > > > Bruce Momjian wrote:
> > > > >>I don't see why views should be special. Tables clearly should be
> > > > >>because we can open them directly.
> > > > >>
> > > > >>
> > > > >
> > > > >Ah, I didn't think of that.  Good idea.  So we don't need this patch?
> > > > >
> > > > >
> > > > >
> > > >
> > > > why do we agree on a patch, implement it and reject it then?
> > > > would be easier to reject it before actually implementing it ...
> > > > it is quite hard to explain to a customer that something is rejected
> > > > after approval - even if things are written properly ...
> > >
> > > Agreed.  The problem with this patch is that originally we just wanted
> > > views, and later the idea of putting a query in there was agreed on, so
> > > the feature request has changed over time.
> >
> > BTW, one argument for allowing dumping out of views is that it means
> > they'd act more like tables; you just COPY viewname TO file.
>
> I think the simple argument is that you can SELECT from a table, why not
> COPY from it.  Of course copying INTO a view would not work.  :-(

Aside from legacy, if you do COPY tablename, you know that it's going to
be a 'high speed' copy, while presumably COPY (SELECT * FROM tablename)
will have additional overhead. Of course, this is also an argument
against the patch.

Granted, if we wanted to we could put the brains in the code to figure
out if a COPY (SELECT) is actually (SELECT * FROM table), which means we
could use the fast code-path, but I don't think it's worth the effort.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: TODO item - tid <> operator
Next
From: Bruce Momjian
Date:
Subject: Re: return can contains any row or record functions