pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chrisgoldstar@wp.pl
To: pgsql-bugs@postgresql.org
Subject: BUG #12257: Cause for: Exception 0xC0000005
Date: Wed, 17 Dec 2014 11:34:56 +0000
Message-ID: <20141217113456.1237.19157@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:      12257
Logged by:          Chris Goldstar
Email address:      chrisgoldstar@wp.pl
PostgreSQL version: 9.3.5
Operating system:   Windows 7 64-bit Professional
Description:        

My configuration
================
System:    Windows 7 64-bit Professional
DB engine: Postgres 9.3.5 64-bit
Extension: oracle_fdw 1.1

I have the following foreign table (on Oracle),

create foreign table pds_pojazd
   (pm bigint not null,
    dv bigint not null,
    av bigint not null,
    pr bigint not null,
    op character varying(30) not null,
    wr timestamp without time zone not null,
    vf timestamp without time zone not null,
    vt timestamp without time zone not null,
    st_numer character varying(2000) ,
    st_rodzaj character varying(2000) ,
    st_marka character varying(2000) ,
    st_ubezp character varying(2000) ,
    fk_kierpm bigint ,
    st_wynik character varying(2000)
   )
   server pds_oracle
   OPTIONS (schema 'PDS_PRD', table 'DEF_POJAZD');
alter foreign table pds_pojazd
  owner to postgres;

I have written one function (for test only) as below,

CREATE OR REPLACE FUNCTION pds_vehicle(vehicle_pm bigint, vehicle_number
character varying)
  RETURNS integer AS
$BODY$
declare
  v_pm bigint;
begin
   -- skip function parameters
   select pm into v_pm from pds_pojazd where st_numer = 'RZ8193A' and pm =
av limit 1;
   return v_pm;
end
$BODY$
  LANGUAGE plpgsql volatile
  COST 100;
ALTER FUNCTION pds_vehicle(bigint, character varying)
  OWNER TO postgres;

Calling...
select pds_vehicle(1015627, 'RZ8193A'); -- call one or more times (more than
10)
Everything works fine.

but the following stops the postgres service!

CREATE OR REPLACE FUNCTION pds_vehicle(vehicle_pm bigint, vehicle_number
character varying)
  RETURNS integer AS
$BODY$
declare
  v_pm bigint;
begin
   -- use first parameter
   select pm into v_pm from pds_pojazd where st_numer = 'RZ8193A' and pm =
vehicle_pm limit 1;
   return v_pm;
end
$BODY$
  LANGUAGE plpgsql volatile
  COST 100;
ALTER FUNCTION pds_vehicle(bigint, character varying)
  OWNER TO postgres;

or
  
CREATE OR REPLACE FUNCTION pds_vehicle(vehicle_pm bigint, vehicle_number
character varying)
  RETURNS integer AS
$BODY$
declare
  v_pm bigint;
begin
   -- use second parameter
   select pm into v_pm from pds_pojazd where st_numer = 'RZ8193A' and pm =
vehicle_pm limit 1;
   return v_pm;
end
$BODY$
  LANGUAGE plpgsql volatile
  COST 100;
ALTER FUNCTION pds_vehicle(bigint, character varying)
  OWNER TO postgres;

or

CREATE OR REPLACE FUNCTION pds_vehicle(vehicle_pm bigint, vehicle_number
character varying)
  RETURNS integer AS
$BODY$
declare
  v_pm bigint;
begin
   -- use both parameters
   select pm into v_pm from pds_pojazd where st_numer = vehicle_number and
pm = av limit 1;
   return v_pm;
end
$BODY$
  LANGUAGE plpgsql volatile
  COST 100;
ALTER FUNCTION pds_vehicle(bigint, character varying)
  OWNER TO postgres;

or

CREATE OR REPLACE FUNCTION pds_vehicle(vehicle_pm bigint, vehicle_number
character varying)
  RETURNS integer AS
$BODY$
declare
  v_pm bigint;
begin
   select pm into v_pm from pds_pojazd where st_numer = vehicle_number and
pm = vehicle_pm limit 1;
   return v_pm;
end
$BODY$
  LANGUAGE plpgsql volatile
  COST 100;
ALTER FUNCTION pds_vehicle(bigint, character varying)
  OWNER TO postgres;

Calling...
select pds_vehicle(1015627, 'RZ8193A'); -- call one, two, three, four and
five times works fine
but next call stops the postgres service.
After six call the postgres shows message 'connection to database your_db
lost' and error message in log is like that

Server process (PID xxxx) was terminated by exception 0xC0000005
see C include file "ntstatus.h" for a description of the hexadecimal value.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)  latest in thread

Message-ID: <20141217113456.1237.19157@wrigleys.postgresql.org>
Permalink:  ../20141217113456.1237.19157@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141217113456.1237.19157@wrigleys.postgresql.org

 · 

reply

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: chrisgoldstar@wp.pl
  Subject: Re: BUG #12257: Cause for: Exception 0xC0000005
  In-Reply-To: <20141217113456.1237.19157@wrigleys.postgresql.org>
  References: <20141217113456.1237.19157@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