From: Richard Huxton <dev@archonet.com>
To: Yura Gal <yuragal@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: RETURN QUERY generates error
Date: Thu, 06 Mar 2008 08:24:51 +0000
Message-ID: <47CFAA53.7010309@archonet.com> (raw)
In-Reply-To: <3b6c69d80803052345g31af3b74k6b8878c65197d621@mail.gmail.com>
References: <3b6c69d80803052345g31af3b74k6b8878c65197d621@mail.gmail.com>
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
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: dev@archonet.com, yuragal@gmail.com
Subject: Re: RETURN QUERY generates error
In-Reply-To: <47CFAA53.7010309@archonet.com>
* 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