-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Falling PostgreSQL 9.5.3 when calling Google maps API #28
Comments
I'm wondering if this is the same issue I am running into. I was testing 9.6 and it would crash often. So I tried 9.5.3 and also had crashing. The server I use www_fdw heavily on is 9.4, and that doesn't have any crashing. I traced the crash and it's failing on line 1451 Here is the backtrace from my mingw64 install `` `` `` With the mountain view example above sometimes it finishes but often it crashes - but yields the same location of failure as what I have listed above. |
@robe2 unfortunately I have no time to debug it now. But knowing the line, you can log parameters and dig the problem deeper. |
The server periodically falls . The query itself is executed and returns the result .
LOG: server process (PID 13062) was terminated by signal 11: Segmentation fault
016-07-05 11:05:57 UTC [13070-1] replica@[unknown] WARNING: terminating connection because of crash of another server process
016-07-05 11:05:57 UTC [13070-2] replica@[unknown] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnor
ally and possibly corrupted shared memory.
The example is taken from the documentation:
DROP EXTENSION IF EXISTS www_fdw CASCADE;
CREATE EXTENSION www_fdw;
CREATE SERVER www_fdw_server_geocoder_google FOREIGN DATA WRAPPER www_fdw
OPTIONS (uri 'maps.googleapis.com/maps/api/geocode/xml?sensor=false',
response_type 'xml', response_deserialize_callback 'test_response_deserialize_callback');
CREATE USER MAPPING FOR current_user SERVER www_fdw_server_geocoder_google;
CREATE FOREIGN TABLE www_fdw_geocoder_google (
/* parameters used in request /
address text,
/ fields in response */
"type" text,
"formatted_address" text,
"lat" text,
"lng" text,
"location_type" text
) SERVER www_fdw_server_geocoder_google;
CREATE OR REPLACE FUNCTION test_response_deserialize_callback(options WWWFdwOptions, response xml)
RETURNS SETOF www_fdw_geocoder_google AS $$
DECLARE
rows RECORD;
address text;
type text;
formatted_address text;
lat text;
lng text;
location_type text;
r RECORD;
BEGIN
RAISE INFO 'options parameter: %', options;
RAISE INFO 'response parameter: %', response;
FOR rows IN SELECT unnest(xpath('/GeocodeResponse/result', response)) LOOP
type := (xpath('/result/type/text()', rows.unnest))[1];
formatted_address := (xpath('/result/formatted_address/text()', rows.unnest))[1];
lat := (xpath('/result/geometry/location/lat/text()', rows.unnest))[1];
lng := (xpath('/result/geometry/location/lng/text()', rows.unnest))[1];
location_type := (xpath('/result/geometry/location_type/text()', rows.unnest))[1];
r := ROW(address, type, formatted_address, lat, lng, location_type);
RETURN NEXT r;
END LOOP;
END; $$ LANGUAGE PLPGSQL;
postgres=# select * from www_fdw_geocoder_google where address='1600 Amphitheatre Parkway,Mountain View, CA';
Extension does not work on 9.5.3? Or www_fdw does not work with streaming replication?
The text was updated successfully, but these errors were encountered: