Re: [HACKERS] insertable views - not copy-able ? - Mailing list pgsql-hackers

From wieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] insertable views - not copy-able ?
Date
Msg-id m11d8XM-0003kLC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to insertable views - not copy-able ?  (Daniel Péder <dpeder@infoset.cz>)
List pgsql-hackers
>
> what about this:
> ( it would be nice to have it working, specially for copying values from files into table with default fields, having
thedefault fields doing their job or initialising tables using reduced set of columns ) 
>
> mydb=> create sequence MYSEQ;
> CREATE
> mydb=> create table MYTAB ( ID int4 default nextval('MYSEQ'), NAME text );
> CREATE
> mydb=> create view MYVIEW as select name from MYTAB;
> CREATE
> mydb=> copy MYVIEW from stdin;

    First  this  setup wouldn't work with INSERT too. The INSTEAD
    rule for INSERT is missing. Second COPY  isn't  a  rewritable
    statement,  and  it  will not become such since only commands
    that have a rangetable and a targetlist can be handled by the
    rewriter at all.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #

pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?
Next
From: "Oliver Elphick"
Date:
Subject: Re: [HACKERS] to_char(), md5() (long)