From: ryan.king@noaa.gov
To: pgsql-bugs@postgresql.org
Subject: BUG #13616: MySQL FDW Geometry Not Returning All Records
Date: Fri, 11 Sep 2015 20:07:53 +0000
Message-ID: <20150911200753.363.73990@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: 13616
Logged by: Ryan King
Email address: ryan.king@noaa.gov
PostgreSQL version: 9.4.4
Operating system: Red Hat 4.4.7-11), 64-bit
Description:
Not all the records return when selecting geom columns:
select * from public.public_zones --only 54 records return
select polygon_column from public.public_zones --only 54 records return
select OGR_FID from public.public_zones --all 3000 records return
select name from public.public_zones --all 3000 records return
These are the steps I took to create the FDW:
MySQL:
CREATE TABLE `public_zones` (
`OGR_FID` int(11) NOT NULL AUTO_INCREMENT,
`polygon_column` geometry NOT NULL,
`name` varchar(254) DEFAULT NULL,
UNIQUE KEY `OGR_FID` (`OGR_FID`),
SPATIAL KEY `polygon_column` (`polygon_column`)
) ENGINE=MyISAM AUTO_INCREMENT=18519 DEFAULT CHARSET=latin1;
CREATE VIEW `public_zones_view` AS
select `public_zones`.`OGR_FID` AS
`OGR_FID`,st_astext(`public_zones`.`polygon_column`) AS `polygon_column`,
`public_zones`.`name` AS `name` from `public_zones`;
PostgreSQL:
CREATE EXTENSION mysql_fdw;
CREATE FOREIGN DATA WRAPPER mysql_fdw_db1 HANDLER mysql_fdw_handler
VALIDATOR mysql_fdw_validator;
CREATE SERVER mysql_svr_db1
FOREIGN DATA WRAPPER mysql_fdw_db1
OPTIONS (host 'IPADDRESS', port '3306');
CREATE USER MAPPING FOR username SERVER mysql_svr_db1
OPTIONS (username 'username', password 'password');
CREATE FOREIGN TABLE table_name (
OGR_FID SERIAL NOT NULL,
polygon_column public.geometry NOT NULL,
name varchar(254) DEFAULT NULL,
SERVER mysql_svr_db1
OPTIONS (dbname 'mysqldbname', table_name 'table_name_view');
I read a post that there was a bug in PostGIS 2.1.0 preventing foreign
tables from being output in geometry_columns and geography_columns views and
was supposed to be fixed in PostGIS 2.1.1. We are on 2.1.8.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: ryan.king@noaa.gov
Subject: Re: BUG #13616: MySQL FDW Geometry Not Returning All Records
In-Reply-To: <20150911200753.363.73990@wrigleys.postgresql.org>
References: <20150911200753.363.73990@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