Received: from orion.SAPserv.Hamburg.dsh.de (Tpolaris2.sapham.debis.de [53.2.131.8]) by hub.org (8.9.3/8.9.3) with SMTP id EAA09802; Mon, 18 Oct 1999 04:57:51 -0400 (EDT) (envelope-from wieck@debis.com) Received: by orion.SAPserv.Hamburg.dsh.de for pgsql-sql@postgreSQL.org id m11d8XM-0003kLC; Mon, 18 Oct 99 10:53 MET DST Message-Id: From: wieck@debis.com (Jan Wieck) Subject: Re: [HACKERS] insertable views - not copy-able ? To: dpeder@infoset.cz (=?iso-8859-2?Q?Daniel_P=E9der?=) Date: Mon, 18 Oct 1999 10:53:00 +0200 (MET DST) Cc: pgsql-hackers@postgreSQL.org, pgsql-sql@postgreSQL.org Reply-To: wieck@debis.com (Jan Wieck) In-Reply-To: <01BF18EA.81DB25A0@Dan> from "=?iso-8859-2?Q?Daniel_P=E9der?=" at Oct 17, 99 09:56:45 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text > > what about this: > ( it would be nice to have it working, specially for copying values from files into table with default fields, having the default 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) #