Merge pull request #2765 from mapycz/fix-pg-datasource-srid

postgis: prefix table name with schema
This commit is contained in:
Dane Springmeyer 2015-05-14 23:06:51 -07:00
commit 7a2aae15d3

View File

@ -154,10 +154,6 @@ postgis_datasource::postgis_datasource(parameters const& params)
schema_ = geometry_table_.substr(0, idx);
geometry_table_ = geometry_table_.substr(idx + 1);
}
else
{
geometry_table_ = geometry_table_.substr(0);
}
// NOTE: geometry_table_ how should ideally be a table name, but
// there are known edge cases where this will break down and
@ -234,6 +230,10 @@ postgis_datasource::postgis_datasource(parameters const& params)
s << "SELECT ST_SRID(\"" << geometryColumn_ << "\") AS srid FROM ";
if (!geometry_table_.empty())
{
if (!schema_.empty())
{
s << schema_ << '.';
}
s << geometry_table_;
}
else