Index: trunk/phase3/includes/installer/PostgresInstaller.php |
— | — | @@ -219,8 +219,8 @@ |
220 | 220 | $conn = $status->value; |
221 | 221 | |
222 | 222 | $dbName = $this->getVar( 'wgDBname' ); |
223 | | - $SQL = "SELECT 1 FROM pg_catalog.pg_database WHERE datname = " . $conn->addQuotes( $dbName ); |
224 | | - $rows = $conn->numRows( $conn->query( $SQL ) ); |
| 223 | + $SQL = "SELECT 1 FROM pg_catalog.pg_database WHERE datname = " . $conn->addQuotes( $dbName ); |
| 224 | + $rows = $conn->numRows( $conn->query( $SQL ) ); |
225 | 225 | if( !$rows ) { |
226 | 226 | $schema = $this->getVar( 'wgDBmwschema' ); |
227 | 227 | $user = $this->getVar( 'wgDBuser' ); |
— | — | @@ -233,14 +233,14 @@ |
234 | 234 | $conn->query( "CREATE DATABASE $safedb OWNER $safeuser", __METHOD__ ); |
235 | 235 | |
236 | 236 | $conn = new DatabasePostgres( |
237 | | - $this->getVar( 'wgDBserver' ), |
238 | | - $this->getVar( 'wgDBuser' ), |
239 | | - $this->getVar( 'wgDBpassword' ), |
240 | | - $dbName, |
241 | | - false, |
242 | | - 0, |
243 | | - $this->getVar( 'wgDBprefix' ) |
244 | | - ); |
| 237 | + $this->getVar( 'wgDBserver' ), |
| 238 | + $this->getVar( 'wgDBuser' ), |
| 239 | + $this->getVar( 'wgDBpassword' ), |
| 240 | + $dbName, |
| 241 | + false, |
| 242 | + 0, |
| 243 | + $this->getVar( 'wgDBprefix' ) |
| 244 | + ); |
245 | 245 | |
246 | 246 | $result = $conn->schemaExists( $schema ); |
247 | 247 | if( !$result ) { |
— | — | @@ -250,16 +250,16 @@ |
251 | 251 | } |
252 | 252 | } else { |
253 | 253 | $safeschema2 = $conn->addQuotes( $schema ); |
254 | | - $SQL = "SELECT 'GRANT ALL ON '||pg_catalog.quote_ident(relname)||' TO $safeuser;'\n". |
255 | | - "FROM pg_catalog.pg_class p, pg_catalog.pg_namespace n\n". |
256 | | - "WHERE relnamespace = n.oid AND n.nspname = $safeschema2\n". |
257 | | - "AND p.relkind IN ('r','S','v')\n"; |
258 | | - $SQL .= "UNION\n"; |
259 | | - $SQL .= "SELECT 'GRANT ALL ON FUNCTION '||pg_catalog.quote_ident(proname)||'('||\n". |
260 | | - "pg_catalog.oidvectortypes(p.proargtypes)||') TO $safeuser;'\n". |
261 | | - "FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n\n". |
262 | | - "WHERE p.pronamespace = n.oid AND n.nspname = $safeschema2"; |
263 | | - $res = $conn->query( $SQL ); |
| 254 | + $SQL = "SELECT 'GRANT ALL ON '||pg_catalog.quote_ident(relname)||' TO $safeuser;'\n". |
| 255 | + "FROM pg_catalog.pg_class p, pg_catalog.pg_namespace n\n" . |
| 256 | + "WHERE relnamespace = n.oid AND n.nspname = $safeschema2\n" . |
| 257 | + "AND p.relkind IN ('r','S','v')\n"; |
| 258 | + $SQL .= "UNION\n"; |
| 259 | + $SQL .= "SELECT 'GRANT ALL ON FUNCTION '||pg_catalog.quote_ident(proname)||'('||\n". |
| 260 | + "pg_catalog.oidvectortypes(p.proargtypes)||') TO $safeuser;'\n" . |
| 261 | + "FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n\n" . |
| 262 | + "WHERE p.pronamespace = n.oid AND n.nspname = $safeschema2"; |
| 263 | + $res = $conn->query( $SQL ); |
264 | 264 | $conn->query( "SET search_path = $safeschema" ); |
265 | 265 | } |
266 | 266 | } |