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

Need help with simple update / insert trigger

From: Matthew Wilson <matt(at)tplus1(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Need help with simple update / insert trigger
Date: 2008-08-28 15:15:06
Message-ID: slrngbdg7q.iki.matt@sprout.tplus1.com (view raw or flat)
Thread:
Lists: pgsql-general
I have table sort of like this:

create table snoz (
    a bool default false,
    b bool default false,
    c bool default false
);

I want to set up a trigger so that any time a row is inserted or
updated, the value of c is set to true if a and/or b is true.

How can I do this?

Thanks!

Matt


pgsql-general by date

Next:From: Douglas McNaughtDate: 2008-08-28 15:21:24
Subject: Re: WAL file questions - how to relocate on Windows, how to replay after total loss, etc
Previous:From: Devrim GÜNDÜZDate: 2008-08-28 15:10:54
Subject: Re: upgrading from 8.1.4 to 8.3.3

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