From: vcolborn@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14408: Schema not found error when 2 or more indices declared on temporary table
Date: Tue, 01 Nov 2016 19:26:55 +0000
Message-ID: <20161101192655.15987.25903@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: 14408
Logged by: Victor Colborn
Email address: vcolborn@gmail.com
PostgreSQL version: 9.6.1
Operating system: (Red Hat 4.4.7-16), 64-bit
Description:
I'm finding that this rather simple postgresql 9.6.1 function
CREATE OR REPLACE FUNCTION trying_to_index_me()
RETURNS VOID AS
$BODY$
BEGIN
CREATE Temporary TABLE temp_data_to_index (
id INTEGER NOT NULL,
this_id UUID NOT NULL,
that_id smallint NOT NULL,
CONSTRAINT idx_temp_data_to_index_unique
UNIQUE (id,this_id,that_id)
);
CREATE INDEX idx_temp_data_to_index_thisthat ON
temp_data_to_index(this_id,that_id);
DROP TABLE temp_data_to_index;
END;
$BODY$ LANGUAGE plpgsql VOLATILE COST 100;
--SELECT trying_to_index_me();
is resulting in a schema "" does not exist error. The exact error is:
ERROR: schema "" does not exist
CONTEXT: SQL statement "CREATE INDEX idx_temp_data_to_index_thisthat ON
temp_data_to_index(this_id,that_id)"
PL/pgSQL function trying_to_index_me() line 10 at SQL statement
********** Error **********
ERROR: schema "" does not exist
SQL state: 3F000
Context: SQL statement "CREATE INDEX idx_temp_data_to_index_thisthat ON
temp_data_to_index(this_id,that_id)"
PL/pgSQL function trying_to_index_me() line 10 at SQL statement
and occurs reliably on the second and subsequent executions. Cut/Pasting the
above SQL chunk reproduces the error...for me. Quite interested if that's
not the case elsewhere. I have the following clues:
It will error consistently once its in.
It always indicates the 'CREATE INDEX' line as the culprit of error.
Declaring the pg_temp temporary schema as '... ON pg_temp.temp_data_to_index
...' has no effect.
I find that if I drop the function and recreate it, I'll get one execution
and then the errored state will occur again.
Inserting records also had no effect on the error state.
I find that removing either idx_temp_data_to_index_thisthat or
idx_temp_data_to_index_unique resolves the issue.
It indicates the name of the not found schema to be "" or "0MA{Start of
Text}" or some similar variant with non-visible character values.
Truly appreciate your thoughts.
--
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: vcolborn@gmail.com
Subject: Re: BUG #14408: Schema not found error when 2 or more indices declared on temporary table
In-Reply-To: <20161101192655.15987.25903@wrigleys.postgresql.org>
References: <20161101192655.15987.25903@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