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@svana.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