From: marcos.castedo@anachronics.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14414: SPI_ERROR_CONNECT on stable plpgsql function used for domain check
Date: Sun, 06 Nov 2016 01:09:47 +0000
Message-ID: <20161106010947.1387.66380@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14414
Logged by: Marcos Castedo
Email address: marcos.castedo@anachronics.com
PostgreSQL version: 9.6.1
Operating system: Debian stretch
Description:
I'm trying to do a domain using stable plpgsql function for value check.
This isn't working on 9.6.x on plpgsql using assignment from base data type,
but it works fine on 9.2.x.
Test case:
BEGIN;
--Only fails on stable function, immutable works fine
CREATE OR REPLACE FUNCTION x_domain_test_check()
RETURNS boolean AS $$
BEGIN
RETURN true;
END;
$$ LANGUAGE plpgsql STABLE;
CREATE DOMAIN x_domain_test AS integer CHECK(x_domain_test_check());
DO $$
DECLARE
v_test x_domain_test;
BEGIN
v_test := 1;
END;
$$;
ROLLBACK;
Output on PostgreSQL 9.2.17 (expected)
DO
ROLLBACK
Output on PostgreSQL 9.6.1 (error)
ERROR: SPI_connect failed: SPI_ERROR_CONNECT
CONTEXT: PL/pgSQL function inline_code_block line 5 at assignment
ROLLBACK
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: marcos.castedo@anachronics.com
Subject: Re: BUG #14414: SPI_ERROR_CONNECT on stable plpgsql function used for domain check
In-Reply-To: <20161106010947.1387.66380@wrigleys.postgresql.org>
References: <20161106010947.1387.66380@wrigleys.postgresql.org>
* 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