Re: RETURN QUERY generates error

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: RETURN QUERY generates error
Дата
Msg-id 47CFAA53.7010309@archonet.com
обсуждение исходный текст
Ответ на RETURN QUERY generates error  ("Yura Gal" <yuragal@gmail.com>)
Ответы Re: RETURN QUERY generates error
Список pgsql-sql
Yura Gal wrote:
>
>   IF _byblocks IS TRUE THEN
>       RETURN QUERY SELECT
> regexp_split_to_table(array_to_string(_sequence, ','), E',');
>   ELSE
>       RETURN QUERY SELECT array_to_string(_sequence, '');
>   END IF;
>   RETURN;
> END;
> $body$
> LANGUAGE 'plpgsql' IMMUTABLE CALLED ON NULL INPUT SECURITY INVOKER;
> 
> all is fine until the last IF. Both RETURN QUERY blocks generate
> error: 'syntax error at or near SELECT ...' I feel that something
> wrong with casting _sequence var but I can't figure out the exact
> point.

Can't think why it's not happy - if I create an empty table to go with 
it, it runs here. If you replace them with RETURN QUERY SELECT '' does 
that make the error go away?

Oh, and are you sure you mean IMMUTABLE? That's only true if hg18.genome 
is a static table.

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Bit string help, please
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: RETURN QUERY generates error