Re: BUG #17161: Assert failed on opening a relation that exists in two schemas via the LANGUAGE SQL function

Поиск
Список
Период
Сортировка
От Alexander Lakhin
Тема Re: BUG #17161: Assert failed on opening a relation that exists in two schemas via the LANGUAGE SQL function
Дата
Msg-id 25f71277-c45a-8ef2-ef9a-9054c3d6e0b0@gmail.com
обсуждение исходный текст
Ответ на BUG #17161: Assert failed on opening a relation that exists in two schemas via the LANGUAGE SQL function  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17161: Assert failed on opening a relation that exists in two schemas via the LANGUAGE SQL function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
25.08.2021 23:00, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference:      17161
> Logged by:          Alexander Lakhin
> Email address:      exclusion@gmail.com
> PostgreSQL version: 14beta3
> Operating system:   Ubuntu 20.04
> Description:        
>
> When executing the following query (based on the create_function_3 test):
> CREATE TABLE functest2 (a int, b int);
>
> CREATE SCHEMA temp_func_test;
> SET search_path TO temp_func_test, public;
> CREATE TABLE functest2 (a int, b int);
>
> CREATE FUNCTION functest_sri1() RETURNS SETOF int
>     LANGUAGE SQL
>     STABLE
>         RETURN (SELECT count(a) FROM functest2);
>
> SELECT * FROM functest_sri1();
>
My initial conclusion was incorrect. Duplicate relation is not needed in
the second schema. It's sufficient to just change search_path to another
schema:

CREATE TABLE functest2 (a int, b int);

CREATE SCHEMA temp_func_test;
SET search_path TO temp_func_test, public;

CREATE FUNCTION functest_sri1() RETURNS SETOF int
    LANGUAGE SQL
    STABLE
        RETURN (SELECT count(a) FROM functest2);

SELECT * FROM functest_sri1();

Best regards,
Alexander



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17163: spgist index scan statistics stays at 0
Следующее
От: Yongqian Li
Дата:
Сообщение: Unexpected behavior from using default config value