Re: Rule Creates Duplicates retry - Mailing list pgsql-sql

From Tom Lane
Subject Re: Rule Creates Duplicates retry
Date
Msg-id 9355.1045640394@sss.pgh.pa.us
Whole thread Raw
In response to Rule Creates Duplicates retry  ("Martin Davidsson" <mhdavids@ncsu.edu>)
List pgsql-sql
"Martin Davidsson" <mhdavids@ncsu.edu> writes:
> I then create a rule to seperate these logs into more
> logical columns, like this:
> create rule split_log as on insert to messyTable where message like
> '%website.url%' do insert into cleanTable values (
> split_part(syslogtb.message,' | ',1),
> split_part(syslogtb.message,' | ',2),
> .....
> split_part(syslogtb.message,' | ',n)
> );

Not certain, but I think you want to be referring to NEW.message,
not messyTable.message (assuming syslogtb is what you meant by
messyTable...).  If you don't refer to NEW then you are likely
to get some bizarre join-of-existing-rows behavior out of this.
        regards, tom lane


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Drop temporary table only if it exists
Next
From: "Troy"
Date:
Subject: Re: once again, sorting with Unicode