Re: [pg_dump] 'create index' statement is failing due to search_path is empty - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [pg_dump] 'create index' statement is failing due to search_path is empty
Date
Msg-id 28215.1588084263@sss.pgh.pa.us
Whole thread Raw
In response to [pg_dump] 'create index' statement is failing due to search_path isempty  (tushar <tushar.ahuja@enterprisedb.com>)
List pgsql-hackers
tushar <tushar.ahuja@enterprisedb.com> writes:
> While testing something else ,i found 1 scenario  where pg_dump  is failing

> CREATE FUNCTION do_analyze() RETURNS VOID VOLATILE LANGUAGE SQL
>          AS 'ANALYZE pg_am';
> CREATE FUNCTION wrap_do_analyze(c INT) RETURNS INT IMMUTABLE LANGUAGE SQL
>          AS 'SELECT $1 FROM do_analyze()';
> CREATE INDEX ON vaccluster(wrap_do_analyze(i));
> INSERT INTO vaccluster VALUES (1), (2);

You failed to schema-qualify the function reference.  That's not
a pg_dump bug.

While we're on the subject: this is an intentionally unsafe index.
The system doesn't try very hard to prevent you from lying about the
volatility status of a function ... but when, not if, it breaks
we're not going to regard the consequences as a Postgres bug.
Basically, there isn't anything about this example that I'm not
going to disclaim as "that's not supported".

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jesse Zhang
Date:
Subject: Re: Fix compilation failure against LLVM 11
Next
From: Stephen Frost
Date:
Subject: Re: More efficient RI checks - take 2