Search Postgresql Archives

Re: Emulating trigger BEFORE SELECT behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux