Changeset 11352

Show
Ignore:
Timestamp:
04/25/07 17:43:48 (2 years ago)
Author:
mloskot
Message:

Added schema name quoting to DROP and CREATE TABLE commands in PG driver. Improvements related to Ticket #1412.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/ogr/ogrsf_frmts/pg/ogrpgdatasource.cpp

    r10944 r11352  
    466466    } 
    467467 
    468     sprintf( szCommand, "DROP TABLE %s.\"%s\" CASCADE", osSchemaName.c_str(), osTableName.c_str() ); 
     468    sprintf( szCommand, "DROP TABLE \"%s\".\"%s\" CASCADE", osSchemaName.c_str(), osTableName.c_str() ); 
    469469    CPLDebug( "OGR_PG", "PGexec(%s)", szCommand ); 
    470470    hResult = PQexec( hPGConn, szCommand ); 
     
    617617    { 
    618618        sprintf( szCommand, 
    619                  "CREATE TABLE %s.\"%s\" ( " 
     619                 "CREATE TABLE \"%s\".\"%s\" ( " 
    620620                 "   OGC_FID SERIAL, " 
    621621                 "   WKB_GEOMETRY %s, " 
     
    626626    { 
    627627        sprintf( szCommand, 
    628                  "CREATE TABLE %s.\"%s\" ( OGC_FID SERIAL, CONSTRAINT \"%s_pk\" PRIMARY KEY (OGC_FID) )", 
     628                 "CREATE TABLE \"%s\".\"%s\" ( OGC_FID SERIAL, CONSTRAINT \"%s_pk\" PRIMARY KEY (OGC_FID) )", 
    629629                 pszSchemaName, pszTableName, pszTableName ); 
    630630    }