Re: Rule Creates Duplicates retry

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Martin Davidsson" <mhdavids(at)ncsu(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rule Creates Duplicates retry
Date: 2003-02-19 07:39:54
Message-ID: 9355.1045640394@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Martin Davidsson" <mhdavids(at)ncsu(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Troy 2003-02-19 10:49:28 Re: once again, sorting with Unicode
Previous Message Josh Berkus 2003-02-19 06:29:25 Re: Drop temporary table only if it exists