pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
To: pgsql-sql@postgresql.org
Subject: Re: dynmic column names inside trigger?
Date: Fri, 23 Nov 2007 18:06:12 +0100
Message-ID: <20071123170611.GA31463@apartia.fr> (raw)
In-Reply-To: <4743F6E5.A3DD.0030.0@indicator.be>
References: <20071120161258.GA27106@apartia.fr>
	<4743F6E5.A3DD.0030.0@indicator.be>

On Wed, Nov 21, 2007 at 09:14:14AM +0100, Bart Degryse wrote:
> I would do something like this (not tested, but conceptually working):
>  
> CREATE or replace FUNCTION sanitize_text(webtext IN text, cleantext OUT text) AS
> $body$
> BEGIN
> cleantext = translate(webtext, E'\x92\x96', '''-');
> cleantext = regexp_replace(cleantext, E'\x9c', 'oe', 'g');
> cleantext = regexp_replace(cleantext, E'\x85', '...', 'g');
> END;
> $body$
> LANGUAGE plpgsql VOLATILE RETURNS NULL ON NULL INPUT;

Hi, 

I was curious as to why you created this function with a prototype of 

	func(intext IN text, outtext OUT text) ... returns NULL

instead of the usual

	func(intext text) ... returns TEXT 

Is that a more efficient way?



view thread (9+ messages)  latest in thread

Message-ID: <20071123170611.GA31463@apartia.fr>
Permalink:  ../20071123170611.GA31463@apartia.fr/
Also on:    postgresql.org/message-id/20071123170611.GA31463@apartia.fr

 · 

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: vindex+lists-pgsql-sql@apartia.org
  Subject: Re: dynmic column names inside trigger?
  In-Reply-To: <20071123170611.GA31463@apartia.fr>

* 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