Re: Emulating trigger BEFORE SELECT behavior
| От | Adrian Klaver |
|---|---|
| Тема | Re: Emulating trigger BEFORE SELECT behavior |
| Дата | |
| Msg-id | 5170037B.4020008@gmail.com обсуждение исходный текст |
| Ответ на | Re: Emulating trigger BEFORE SELECT behavior (Atri Sharma <atri.jiit@gmail.com>) |
| Список | pgsql-general |
On 04/18/2013 07:19 AM, Atri Sharma wrote: >> >> So what would you run the SELECT against, another view or table? > > No, what I meant was: > > SELECT on main table: fires a rule which updates a view V1 > > Now, essentially, view V1 has the data I was trying to acquire > originally through BEFORE INSERT trigger. > > When I need the data, I can query view V1. Fair warning, it is morning here, the body is up, the brain cells are lagging behind:) So here it goes, from the docs: "Presently, ON SELECT rules must be unconditional INSTEAD rules and must have actions that consist of a single SELECT command" So if you want to do an UPDATE I'm guessing you will need to create a function for the SELECT. Basically Alfonso's previous suggestion. This is where things can start getting tricky. This is where I grab a pencil and start laying out ideas on paper. Right now I cannot offer anything more than that. > > Atri > > > -- > Regards, > > Atri > l'apprenant > > -- Adrian Klaver adrian.klaver@gmail.com
В списке pgsql-general по дате отправления: