Hi Kevin,
Sorry, that's the wrong way around. I should have said:
>
> Your BEFORE UPDATE trigger could leave the "synced" value in NEW
> alone if force_sync was **true**, and set "synced" to false
> otherwise. It could then set NEW.force_sync to false, to leave you
> ready for the next update.
>
Kevin Grittner wrote:
> Your BEFORE UPDATE trigger could leave the "synced" value in NEW
> alone if force_sync was false, and set "synced" to false
> otherwise. It could then set NEW.force_sync to false, to leave you
> ready for the next update.
Sorry, that's the wrong way around. I should hav
Clemens Eisserer wrote:
> Here is what I am trying to achieve: Set "synced" to false at any
> update, except when it has been set explicitly to true.
> This does not seem to be possible, without checking the value SET
> by UPDATE?
Right; since there is no way to check whether a 'true' value ther
Hi,
NEW reflects what the row will look like after the UPDATE. There
> is no way to tell which columns were specified in the SET clause of
> the UPDATE; a column which is omitted from that clause will look
> exactly the same as a column which is set to the value it already
> had.
>
Thanks a lot
On 5/4/13 at 6:59 AM, Clemens Eisserer wrote:
Sorry for this newbie-question, I am trying for quite some time now to get
the following trigger-function to work properly:
CREATE OR REPLACE FUNCTION update_synced_column()
RETURNS trigger AS
$BODY$
BEGIN
IF NEW.synced IS NULL THEN
NEW.synced := f
Clemens Eisserer wrote:
> I am trying for quite some time now to get the following
> trigger-function to work properly:
>
> CREATE OR REPLACE FUNCTION update_synced_column()
> RETURNS trigger AS
> $BODY$
> BEGIN
> IF NEW.synced IS NULL THEN
> NEW.synced := false;
> END IF;
> RETU
Hi,
Sorry for this newbie-question, I am trying for quite some time now to get
the following trigger-function to work properly:
CREATE OR REPLACE FUNCTION update_synced_column()
RETURNS trigger AS
$BODY$
BEGIN
IF NEW.synced IS NULL THEN
NEW.synced := false;
END IF;
RETURN NEW;
END