Skip site navigation (1) Skip section navigation (2)

Re: INSERT rule

From: "Darko Prenosil" <Darko(dot)Prenosil(at)finteh(dot)hr>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT rule
Date: 2004-06-29 17:17:01
Message-ID: 001401c45dff$8d7d4fa0$1e82bfd5@darko (view raw or flat)
Thread:
Lists: pgsql-hackers
God, that was so obvious !
Thanks (again).

Regards !

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Darko Prenosil" <darko(dot)prenosil(at)finteh(dot)hr>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Sent: Tuesday, June 29, 2004 4:18 PM
Subject: Re: [HACKERS] INSERT rule


> Darko Prenosil <darko(dot)prenosil(at)finteh(dot)hr> writes:
> > Just wrote a function that takes view name as argument and generates
INSERT,
> > UPDATE and DELETE rules for that view. It is working OK (thanks to Tom),
but
> > I have trouble with INSERT rule.
> > When inserting directly into table, default values are filled in when
the
> > field is not in the insert target list, but when using rule system field
is
> > filled with NULL.
>
> You want to attach the defaults directly to the view, viz
> ALTER TABLE view ALTER COLUMN col SET DEFAULT whatever;
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>


In response to

pgsql-hackers by date

Next:From: Josh BerkusDate: 2004-06-29 17:36:48
Subject: Re: lock timeout patch
Previous:From: Tom LaneDate: 2004-06-29 14:18:54
Subject: Re: INSERT rule

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group