pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Davidsson <mhdavids@ncsu.edu>
To: pgsql-sql@postgresql.org
Subject: Rule Creates Duplicates retry
Date: Tue, 18 Feb 2003 12:57:12 -0500
Message-ID: <000501c2d777$2a0e1040$62400798@martin> (raw)

Hello,
 
[I sent this email off yesterday, but didn't appear to make it to the
list. Hope nobody gets this twice :(]
 
I have a rule that I've been trying to run against a certain table, but
it always spits out blank rows, in addition to the rows I want.
 
I have Apach logging to a postgresql 7.3 database with each parameter
seperated by a |. 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)
);
 
where n is the number of parameters Apache logs.
 
Without the rule, everything gets properly inserted into mesyTable. I
want to rule in place to seperate out the information. But the rule
produces a cleanTable that contains the expected stuff, but it also
contains duplicates of that stuff, and several empty rows. Is there any
obvious way to avoid either?
 
Thanks!
 
// Martin Davidsson

view thread (2+ messages)  latest in thread

Message-ID: <000501c2d777$2a0e1040$62400798@martin>
Permalink:  ../000501c2d777$2a0e1040$62400798@martin/
Also on:    postgresql.org/message-id/000501c2d777$2a0e1040$62400798@martin

 · 

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: mhdavids@ncsu.edu
  Subject: Re: Rule Creates Duplicates retry
  In-Reply-To: <000501c2d777$2a0e1040$62400798@martin>

* 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