Re: Unable to create a PL/PGSL function : Did I miss something ?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bruno BAGUETTE <pgsql-ml(at)baguette(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Unable to create a PL/PGSL function : Did I miss something ?
Date: 2004-02-08 01:13:59
Message-ID: 20040208011359.GA27476@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Feb 08, 2004 at 01:47:51AM +0100, Bruno BAGUETTE wrote:
> Hello,
>
> I'm trying to build a PL/PGSQL function that will be called by a trigger
> which will update a table named 'mview_contacts'. That table plays the
> role of a materialized view.
>
> The 'plpgsql' language is installed on that database (there are already
> several functions inside) but I don't understand why I can't store that
> function in the database.

You forgot to escape some quotes:

> quote_literal('people') || '',''
^ ^
> || quote_ident('cnt_initial') || '' = ''
^ ^
> || quote_literal('LOWER(SUBSTR(NEW.org_name, 1, 1))')
^ ^

> || quote_ident('cnt_name') || '' = '' ||
> quote_literal('NEW.org_name') || '',''
> || quote_ident('cnt_type') || '' = '' ||
> quote_literal('organization') || '',''
> || quote_ident('cnt_initial') || '' = ''
> || quote_literal('LOWER(SUBSTR(NEW.org_name, 1, 1))')

Several in there

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2004-02-08 05:41:29 Fwd: Favorite DB poll on ORA
Previous Message Bruno BAGUETTE 2004-02-08 00:47:51 Unable to create a PL/PGSL function : Did I miss something ?