pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martin Davidsson <mhdavids@ncsu.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: Rule Creates Duplicates retry
Date: Wed, 19 Feb 2003 02:39:54 -0500
Message-ID: <9355.1045640394@sss.pgh.pa.us> (raw)
In-Reply-To: <000501c2d777$2a0e1040$62400798@martin>
References: <000501c2d777$2a0e1040$62400798@martin>

"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



view thread (2+ messages)

Message-ID: <9355.1045640394@sss.pgh.pa.us>
Permalink:  ../9355.1045640394@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9355.1045640394@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mhdavids@ncsu.edu
  Subject: Re: Rule Creates Duplicates retry
  In-Reply-To: <9355.1045640394@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox