X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id ED5FE30F504 for ; Mon, 23 Jun 2003 08:55:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 17402-01 for ; Mon, 23 Jun 2003 05:55:17 -0300 (ADT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id D284A30F53B for ; Mon, 23 Jun 2003 05:55:16 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19UN6Z-0003ZQ-0Z; Mon, 23 Jun 2003 09:55:16 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 2FF7816CA8; Mon, 23 Jun 2003 09:55:09 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 8C53416890; Mon, 23 Jun 2003 09:55:08 +0100 (BST) Content-Type: text/plain; charset="iso-8859-2" From: Richard Huxton Organization: Archonet Ltd To: Tomasz Myrta Subject: Re: virtual table Date: Mon, 23 Jun 2003 09:54:54 +0100 User-Agent: KMail/1.4.3 Cc: PGSQL-SQL References: <3EF61E44.2020601@klaster.net> <200306230929.24372.dev@archonet.com> <3EF6BCB4.2040209@klaster.net> In-Reply-To: <3EF6BCB4.2040209@klaster.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306230954.54185.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Archive-Number: 200306/257 X-Sequence-Number: 14015 On Monday 23 Jun 2003 9:39 am, Tomasz Myrta wrote: > Dnia 2003-06-23 10:29, U=BFytkownik Richard Huxton napisa=B3: > > Look into views - you'll need to provide triggers to handle the > > update/inserts. > > I think view won't change too much - there is not too much difference for > this case between creating view and empty table with trigger returning > null. I was thinking about something more comfortably - table without > pre-declared columns so I don't have to change table definition when > pl/pgsql function changes. > > Can anyone tell me how triggers work? Do they need to look into table > column definition to retrieve data? Hmm - I think your problem is going to come before that. Any time you do an= =20 INSERT, PostgreSQL is going to need to know the types of all the columns=20 involved. For this sort of thing, I try to keep all the related bits (initial functio= n,=20 views, triggers) in the same text-file to encourage me to remember to updat= e=20 them all together. It sounds like this table1 is only being used during transfer. Is there any= =20 reason why you aren't just inserting the required rows into table2. --=20 Richard Huxton