+ applied postgis_schema patch from dodobas
This commit is contained in:
parent
c95002a0e3
commit
c4b003f568
1 changed files with 16 additions and 0 deletions
|
@ -122,9 +122,25 @@ postgis_datasource::postgis_datasource(parameters const& params)
|
|||
desc_.set_encoding(conn->client_encoding());
|
||||
|
||||
std::string table_name=table_from_sql(table_);
|
||||
std::string schema_name="";
|
||||
std::string::size_type idx=table_name.find_last_of('.');
|
||||
if (idx!=std::string::npos)
|
||||
{
|
||||
schema_name=table_name.substr(0,idx);
|
||||
table_name=table_name.substr(idx+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
table_name=table_name.substr(0);
|
||||
}
|
||||
|
||||
std::ostringstream s;
|
||||
s << "select f_geometry_column,srid,type from ";
|
||||
s << GEOMETRY_COLUMNS <<" where f_table_name='" << table_name<<"'";
|
||||
|
||||
if (schema_name.length() > 0)
|
||||
s <<" and f_table_schema='"<< schema_name <<"'";
|
||||
|
||||
if (geometry_field_.length() > 0)
|
||||
s << " and f_geometry_column = '" << geometry_field_ << "'";
|
||||
|
||||
|
|
Loading…
Reference in a new issue