BUG: Session getting disconnected while executing a function to create materialised views in PostgreSQL 9.6

From: "Saxena, Shivam" <shsaxena(at)teamdrg(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Cc: DB Development DBAs <DBDevelopmentDBAs(at)teamdrg(dot)com>, "Lee, Ming" <milee(at)teamdrg(dot)com>
Subject: BUG: Session getting disconnected while executing a function to create materialised views in PostgreSQL 9.6
Date: 2016-08-11 09:30:06
Message-ID: 97218716-480B-4527-B5CD-D08D798A0C7B@dresources.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dear Team,

While creating a 9.6 database environment we have come across a situation where the session is getting disconnected while running a function. Below are the DB details and function details.

DB Version: PostgreSQL 9.6beta3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17), 64-bit
DB Client: PgAdmin 3 v1.22.1
DB Client Operating System: Mac OS v10.11.3

DB Function definition (sample test function to replicate the issue):-
CREATE OR REPLACE FUNCTION testing_func()
RETURNS void AS $$
BEGIN

DROP MATERIALIZED VIEW IF EXISTS test1;

CREATE MATERIALIZED VIEW test1 AS
(
SELECT 1 as a,2 as b,3 as c,4 as d,5 as e,6 as f
ORDER BY
1
) WITH NO DATA;

END;
$$ LANGUAGE plpgsql;

Replication Scenario:

* Compile the above code. Run select query of the above function (I.e. Select testing_func();)

Result:

* Session gets disconnected forcibly.

Few other observations:

* The same code snippet runs fine in PostreSQL v9.5
* When we remove the clause WITH NO DATA, then the functions runs successfully

Please let me know in case any more details are required from our side.

Regards,
Shivam Saxena

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2016-08-11 12:10:36 Re: BUG: Session getting disconnected while executing a function to create materialised views in PostgreSQL 9.6
Previous Message Dumitru Boldureanu 2016-08-10 15:46:29 Bug fetching Timestamps in JDBC driver 9.4.1209