Re: Parse error a in short stored procedure : What's wrong

Поиск
Список
Период
Сортировка
От Pascal Polleunus
Тема Re: Parse error a in short stored procedure : What's wrong
Дата
Msg-id 40804063.10905@beeznest.net
обсуждение исходный текст
Ответ на Parse error a in short stored procedure : What's wrong ?  ("Bruno BAGUETTE" <pgsql-ml@baguette.net>)
Ответы build contrib  ("John Liu" <johnl@emrx.com>)
ERROR: NEW used in non-rule query (was Parse error a in short stored procedure : What's wrong ?)  ("Bruno BAGUETTE" <pgsql-ml@baguette.net>)
Список pgsql-general
remove a ) at the end, 3 is enough ;-)


Bruno BAGUETTE wrote:
> Hello,
>
> I have a PL/PGSQL stored procedure that makes me mad currently... (The
> stored procedure is a procedure that simulates a materialized view)
>
> It complains about a parse error when I call that procedure :
> WARNING:  line 8 at execute statement
> ERROR:  parser: parse error at or near "organization" at character 144
>
> So, I think that the error is in that piece of code (I've added the line
> number in order to show you the bad line)
>
> 5 : IF TG_RELNAME = ''people'' THEN
> 6 : EXECUTE ''INSERT INTO mview_contacts
> (pk_fk_cnt_id,cnt_name,cnt_type,cnt_initial) VALUES(NEW.pk_fk_cnt_id, '' ||
> quote_literal(COALESCE(NEW.l_name,'''') || '' '' ||
> COALESCE(NEW.f_name,'''')) || '','' ||
> ''''people'',LOWER(SUBSTR((COALESCE(NEW.l_name,''''), 1, 1))))'';
> 7 : ELSIF TG_RELNAME = ''organizations'' THEN
> 8 : EXECUTE ''INSERT INTO mview_contacts
> (pk_fk_cnt_id,cnt_name,cnt_type,cnt_initial) VALUES(NEW.pk_fk_cnt_id, '' ||
> quote_literal(NEW.org_name) || '','' ||
> ''''organization'',LOWER(SUBSTR(NEW.org_name, 1, 1))))'';
>
> Do you see something to be wrong in theses lignes ?
>
> Thanks very much for your help !
>
>
> PS : Is there a tool (on Linux, MacOsX or Windows) that help the writing of
> theses stored procedures ?
>
> --------------------------------------
> Bruno BAGUETTE - pgsql-ml@baguette.net
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match



В списке pgsql-general по дате отправления:

Предыдущее
От: "John Sidney-Woollett"
Дата:
Сообщение: Re: Indexing null dates
Следующее
От: "John Liu"
Дата:
Сообщение: build contrib