From: Richard Huxton <dev@archonet.com>
To: Tomasz Myrta <jasiek@klaster.net>
Cc: PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: virtual table
Date: Mon, 23 Jun 2003 09:54:54 +0100
Message-ID: <200306230954.54185.dev@archonet.com> (raw)
In-Reply-To: <3EF6BCB4.2040209@klaster.net>
References: <3EF61E44.2020601@klaster.net>
<200306230929.24372.dev@archonet.com>
<3EF6BCB4.2040209@klaster.net>
On Monday 23 Jun 2003 9:39 am, Tomasz Myrta wrote:
> Dnia 2003-06-23 10:29, Użytkownik Richard Huxton napisał:
> > 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
INSERT, PostgreSQL is going to need to know the types of all the columns
involved.
For this sort of thing, I try to keep all the related bits (initial function,
views, triggers) in the same text-file to encourage me to remember to update
them all together.
It sounds like this table1 is only being used during transfer. Is there any
reason why you aren't just inserting the required rows into table2.
--
Richard Huxton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, jasiek@klaster.net
Subject: Re: virtual table
In-Reply-To: <200306230954.54185.dev@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox