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

Re: Rules and Views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Travis Hoyt" <thoyt(at)npc(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Rules and Views
Date: 2001-10-09 13:57:39
Message-ID: 26462.1002635859@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
"Travis Hoyt" <thoyt(at)npc(dot)net> writes:
> create rule ins_sun_u as on insert
> to sun_u do instead insert into sardata values ( usr, sys, wio,
> idle, time, systemid );
> ERROR:  Attribute 'usr' not found

You need to write "new.usr", etc.  Essentially, "new" and "old" are
record variables referring to the about-to-be-inserted row (in INSERT
or UPDATE rules) and the about-to-be-deleted row (in UPDATE or DELETE).
Even though sun_u is a view not a real table, you still have to follow
the syntax...

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Herb BlackerDate: 2001-10-09 15:09:21
Subject: Loading current_user and current_timestamp using COPY
Previous:From: Travis HoytDate: 2001-10-09 13:24:26
Subject: Rules and Views

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