Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezpostgresqldb.php
Go to the documentation of this file.
1 <?php
20 class eZPostgreSQLDB extends eZDBInterface
21 {
28 public function __construct( $parameters )
29 {
30 parent::__construct( $parameters );
31
32 if ( !extension_loaded( 'pgsql' ) )
33 {
34 if ( function_exists( 'eZAppendWarningItem' ) )
35 {
36 eZAppendWarningItem( array( 'error' => array( 'type' => 'ezdb',
37 'number' => eZDBInterface::ERROR_MISSING_EXTENSION ),
38 'text' => 'PostgreSQL extension was not found, the DB handler will not be initialized.' ) );
39 $this->IsConnected = false;
40 }
41 eZDebug::writeWarning( 'PostgreSQL extension was not found, the DB handler will not be initialized.', 'eZPostgreSQLDB' );
42 return;
43 }
44
45 eZDebug::createAccumulatorGroup( 'postgresql_total', 'Postgresql Total' );
46
47 $ini = eZINI::instance();
48
49 $server = $this->Server;
50 $port = $this->Port;
51 $db = $this->DB;
52 $user = $this->User;
53 $password = $this->Password;
54
55 $connectString = self::connectString( $this->Server, $this->Port, $this->DB, $this->User, $this->Password );
56
57 if ( $ini->variable( "DatabaseSettings", "UsePersistentConnection" ) == "enabled" && function_exists( "pg_pconnect" ))
58 {
59 eZDebugSetting::writeDebug( 'kernel-db-postgresql', $ini->variable( "DatabaseSettings", "UsePersistentConnection" ), "using persistent connection" );
60
61 // avoid automatic SQL errors
62 $oldHandling = eZDebug::setHandleType( eZDebug::HANDLE_EXCEPTION );
63 eZDebug::accumulatorStart( 'postgresql_connection', 'postgresql_total', 'Database connection' );
64 try {
65 $this->DBConnection = pg_pconnect( $connectString );
66 } catch( ErrorException $e ) {}
67 eZDebug::accumulatorStop( 'postgresql_connection' );
68 eZDebug::setHandleType( $oldHandling );
69
70 $maxAttempts = $this->connectRetryCount();
71 $waitTime = $this->connectRetryWaitTime();
72 $numAttempts = 1;
73 while ( $this->DBConnection == false and $numAttempts <= $maxAttempts )
74 {
75 sleep( $waitTime );
76 $oldHandling = eZDebug::setHandleType( eZDebug::HANDLE_EXCEPTION );
77 eZDebug::accumulatorStart( 'postgresql_connection', 'postgresql_total', 'Database connection' );
78 try {
79 $this->DBConnection = pg_pconnect( $connectString );
80 } catch( ErrorException $e ) {}
81 eZDebug::accumulatorStop( 'postgresql_connection' );
82 eZDebug::setHandleType( $oldHandling );
83 $numAttempts++;
84 }
85 if ( $this->DBConnection )
86 {
87 $this->IsConnected = true;
88 }
89 else
90 {
91 throw new eZDBNoConnectionException( $server, $this->ErrorMessage, $this->ErrorNumber );
92 }
93 }
94 else if ( function_exists( "pg_connect" ) )
95 {
96 eZDebugSetting::writeDebug( 'kernel-db-postgresql', "using real connection", "using real connection" );
97
98 $oldHandling = eZDebug::setHandleType( eZDebug::HANDLE_EXCEPTION );
99 eZDebug::accumulatorStart( 'postgresql_connection', 'postgresql_total', 'Database connection' );
100 try {
101 $this->DBConnection = pg_connect( $connectString );
102 } catch( ErrorException $e ) {}
103 eZDebug::accumulatorStop( 'postgresql_connection' );
104 eZDebug::setHandleType( $oldHandling );
105
106 $maxAttempts = $this->connectRetryCount();
107 $waitTime = $this->connectRetryWaitTime();
108 $numAttempts = 1;
109 while ( $this->DBConnection == false and $numAttempts <= $maxAttempts )
110 {
111 sleep( $waitTime );
112 $oldHandling = eZDebug::setHandleType( eZDebug::HANDLE_EXCEPTION );
113 eZDebug::accumulatorStart( 'postgresql_connection', 'postgresql_total', 'Database connection' );
114 try {
115 $this->DBConnection = pg_connect( $connectString );
116 } catch( ErrorException $e ) {}
117 eZDebug::accumulatorStop( 'postgresql_connection' );
118 eZDebug::setHandleType( $oldHandling );
119 $numAttempts++;
120 }
121 if ( $this->DBConnection )
122 {
123 $this->IsConnected = true;
124 }
125 else
126 {
127 $this->setError();
128 throw new eZDBNoConnectionException( $server, $this->ErrorMessage, $this->ErrorNumber );
129 }
130 }
131 else
132 {
133 $this->IsConnected = false;
134 eZDebug::writeError( "PostgreSQL support not compiled into PHP, contact your system administrator", "eZPostgreSQLDB" );
135
136 }
137 }
138
139 public static function connectString( $server = null, $port = null, $db = null, $user = null, $password = null )
140 {
141 $connectParams = array();
142 if ( $server !== false and $server !== null )
143 $connectParams[] = "host='$server'";
144 if ( $db !== false and $db !== null )
145 $connectParams[] = "dbname='$db'";
146 if ( $user !== false and $user !== null )
147 $connectParams[] = "user='$user'";
148 if ( $password !== false and $password !== null )
149 $connectParams[] = "password='$password'";
150 if ( $port )
151 $connectParams[] = "port='$port'";
152
153 return implode( " ", $connectParams );
154 }
155
156 function availableDatabases()
157 {
158 $query = "SELECT datname FROM pg_database";
159 $result = $this->query( $query );
160
161 $databases = array();
162 $counter = pg_num_rows( $result ) - 1;
163
164 while ( $counter > 0 )
165 {
166 $row = pg_fetch_result( $result, $counter, "datname" );
167 $databases[] = $row;
168 $counter--;
169 }
170
171 pg_free_result( $result );
172
173 return $databases;
174 }
175
176 function databaseName()
177 {
178 return 'postgresql';
179 }
180
181 function bindingType( )
182 {
183 return eZDBInterface::BINDING_NO;
184 }
185
186 function bindVariable( $value, $fieldDef = false )
187 {
188 return $value;
189 }
190
191 function query( $sql, $server = false )
192 {
193 if ( $this->isConnected() )
194 {
195 eZDebug::accumulatorStart( 'postgresql_query', 'postgresql_total', 'Postgresql queries' );
196 if ( $this->OutputSQL )
197 {
198 $this->startTimer();
199 }
200 // postgres will by default cast an error if a query fails
201 // exception handling mode needs to catch this exception and set the $result variable to false
202 if ( $this->errorHandling == eZDB::ERROR_HANDLING_EXCEPTIONS )
203 {
204 $oldHandling = eZDebug::setHandleType( eZDebug::HANDLE_EXCEPTION );
205 try {
206 $result = pg_query( $this->DBConnection, $sql );
207 } catch( ErrorException $e ) {
208 $result = false;
209 }
210 eZDebug::setHandleType( $oldHandling );
211 }
212 else
213 {
214 $result = pg_query( $this->DBConnection, $sql );
215 }
216
217 if ( $this->OutputSQL )
218 {
219 $this->endTimer();
220 if ($this->timeTaken() > $this->SlowSQLTimeout)
221 {
222 $this->reportQuery( 'eZPostgreSQLDB', $sql, false, $this->timeTaken() );
223 }
224 }
225 eZDebug::accumulatorStop( 'postgresql_query' );
226
227 if ( !$result )
228 {
229 $this->setError();
230 eZDebug::writeError( "Error: error executing query: $sql: {$this->ErrorMessage}", "eZPostgreSQLDB" );
231 if ( $this->errorHandling == eZDB::ERROR_HANDLING_EXCEPTIONS )
232 {
233 throw new eZDBException( $this->ErrorMessage, $this->ErrorNumber );
234 }
235 $this->reportError();
236 }
237 }
238 else
239 $result = false;
240 return $result;
241 }
242
243
244 function arrayQuery( $sql, $params = array(), $server = false )
245 {
246 $retArray = array();
247 if ( $this->isConnected() )
248 {
249 $limit = -1;
250 $offset = 0;
251 // check for array parameters
252 if ( is_array( $params ) )
253 {
254 // $params = $min;
255
256
257 $column = false;
258 if ( isset( $params["limit"] ) and is_numeric( $params["limit"] ) )
259 {
260 $limit = $params["limit"];
261 }
262
263 if ( isset( $params["offset"] ) and is_numeric( $params["offset"] ) )
264 {
265 $offset = $params["offset"];
266 }
267 if ( isset( $params["column"] ) and ( is_numeric( $params["column"] ) or is_string( $params["column"] ) ) )
268 $column = $params["column"];
269 }
270
271 if ( $limit != -1 )
272 {
273 $sql .= "\nLIMIT $limit";
274 }
275 if ( $offset > 0 )
276 {
277 if ( $limit == -1 )
278 $sql .= "\n";
279 else
280 $sql .= " ";
281 $sql .= "OFFSET $offset";
282 }
283
284 eZDebug::accumulatorStart( 'postgresql_query', 'postgresql_total', 'Postgresql queries' );
285
286 $result = $this->query( $sql );
287
288 eZDebug::accumulatorStop( 'postgresql_query' );
289
290 if ( $result == false )
291 {
292 return false;
293 }
294
295 if ( pg_num_rows( $result ) > 0 )
296 {
297 eZDebug::accumulatorStart( 'postgresql_loop', 'postgresql_total', 'Looping result' );
298 if ( !is_string( $column ) )
299 {
300 for($i = 0; $i < pg_num_rows($result); $i++)
301 {
302 $retArray[$i + $offset] = pg_fetch_array( $result, $i, PGSQL_ASSOC );
303 }
304 }
305 else
306 {
307 for ($i = 0; $i < pg_num_rows( $result ); $i++ )
308 {
309 $tmp_row = pg_fetch_array( $result, $i, PGSQL_ASSOC );
310 $retArray[$i + $offset] =& $tmp_row[$column];
311 }
312 }
313 eZDebug::accumulatorStart( 'postgresql_loop' );
314 }
315 pg_free_result( $result );
316 }
317 return $retArray;
318 }
319
323 function subString( $string, $from, $len = null )
324 {
325 if ( $len == null )
326 {
327 return " substring( $string from $from ) ";
328 }else
329 {
330 return " substring( $string from $from for $len ) ";
331 }
332
333 }
334
335 function concatString( $strings = array() )
336 {
337 $str = implode( " || " , $strings );
338 return " $str ";
339 }
340
341 function md5( $str )
342 {
343 return " encode(digest( $str, 'md5' ), 'hex' ) ";
344 }
345
346 function supportedRelationTypeMask()
347 {
348 return ( eZDBInterface::RELATION_TABLE_BIT |
349 eZDBInterface::RELATION_SEQUENCE_BIT |
350 eZDBInterface::RELATION_TRIGGER_BIT |
351 eZDBInterface::RELATION_VIEW_BIT |
352 eZDBInterface::RELATION_INDEX_BIT );
353 }
354
355 function supportedRelationTypes()
356 {
357 return array( eZDBInterface::RELATION_TABLE,
358 eZDBInterface::RELATION_SEQUENCE,
359 eZDBInterface::RELATION_TRIGGER,
360 eZDBInterface::RELATION_VIEW,
361 eZDBInterface::RELATION_INDEX );
362 }
363
367 function relationKind( $relationType )
368 {
369 $kind = array( eZDBInterface::RELATION_TABLE => 'r',
370 eZDBInterface::RELATION_SEQUENCE => 'S',
371 eZDBInterface::RELATION_TRIGGER => 't',
372 eZDBInterface::RELATION_VIEW => 'v',
373 eZDBInterface::RELATION_INDEX => 'i' );
374 if ( !isset( $kind[$relationType] ) )
375 return false;
376 return $kind[$relationType];
377 }
378
379 function relationCounts( $relationMask )
380 {
381 $relationTypes = $this->supportedRelationTypes();
382 $relationKinds = array();
383 foreach ( $relationTypes as $relationType )
384 {
385 $relationBit = ( 1 << $relationType );
386 if ( $relationMask & $relationBit )
387 {
388 $relationKind = $this->relationKind( $relationType );
389 if ( $relationKind )
390 $relationKinds[] = $relationKind;
391 }
392 }
393 if ( count( $relationKinds ) == 0 )
394 return 0;
395 $count = false;
396 $relkindText = '';
397 $i = 0;
398 foreach ( $relationKinds as $relationKind )
399 {
400 if ( $i > 0 )
401 $relkindText .= ' OR ';
402 $relkindText .= "relkind='$relationKind'";
403 $i++;
404 }
405 if ( $this->isConnected() )
406 {
407 $sql = "SELECT COUNT( relname ) as count
408 FROM pg_catalog.pg_class c
409 LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
410 WHERE ( $relkindText )
411 AND c.relname !~ '^pg_'
412 AND pg_catalog.pg_table_is_visible(c.oid)";
413 $array = $this->arrayQuery( $sql, array( 'column' => 'count' ) );
414 $count = $array[0];
415 }
416 return $count;
417 }
418
419 function relationCount( $relationType = eZDBInterface::RELATION_TABLE )
420 {
421 $count = false;
422 $relationKind = $this->relationKind( $relationType );
423 if ( !$relationKind )
424 {
425 eZDebug::writeError( "Unsupported relation type '$relationType'", __METHOD__ );
426 return false;
427 }
428
429 if ( $this->isConnected() )
430 {
431 $sql = "SELECT COUNT( relname ) as count
432 FROM pg_catalog.pg_class c
433 LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
434 WHERE c.relkind = '$relationKind'
435 AND c.relname !~ '^pg_'
436 AND pg_catalog.pg_table_is_visible(c.oid)";
437 $array = $this->arrayQuery( $sql, array( 'column' => 'count' ) );
438 $count = $array[0];
439 }
440 return $count;
441 }
442
443 function relationList( $relationType = eZDBInterface::RELATION_TABLE )
444 {
445 $count = false;
446 $relationKind = $this->relationKind( $relationType );
447 if ( !$relationKind )
448 {
449 eZDebug::writeError( "Unsupported relation type '$relationType'", __METHOD__ );
450 return false;
451 }
452
453 $array = array();
454 if ( $this->isConnected() )
455 {
456 $sql = "SELECT relname
457 FROM pg_catalog.pg_class c
458 LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
459 WHERE c.relkind = '$relationKind'
460 AND c.relname !~ '^pg_'
461 AND pg_catalog.pg_table_is_visible( c.oid )";
462 $array = $this->arrayQuery( $sql, array( 'column' => 'relname' ) );
463 }
464 return $array;
465 }
466
467 function eZTableList( $server = eZDBInterface::SERVER_MASTER )
468 {
469 $array = array();
470 if ( $this->isConnected() )
471 {
472 foreach ( array( eZDBInterface::RELATION_TABLE, eZDBInterface::RELATION_SEQUENCE ) as $relationType )
473 {
474 $sql = "SELECT relname FROM pg_class WHERE relkind='" . $this->relationKind( $relationType ) . "' AND relname like 'ez%'";
475 foreach ( $this->arrayQuery( $sql, array( 'column' => 'relname' ) ) as $result )
476 {
477 $array[$result] = $relationType;
478 }
479 }
480 }
481 return $array;
482 }
483
484 function relationMatchRegexp( $relationType )
485 {
486 return "#^(ez|tmp_notification_rule_s)#";
487 }
488
489 function removeRelation( $relationName, $relationType )
490 {
491 $relationTypeName = $this->relationName( $relationType );
492 if ( !$relationTypeName )
493 {
494 eZDebug::writeError( "Unsupported relation type '$relationType'", __METHOD__ );
495 return false;
496 }
497
498 if ( $this->isConnected() )
499 {
500 $sql = "DROP $relationTypeName $relationName";
501 return $this->query( $sql );
502 }
503 return false;
504 }
505
506 function lock( $table )
507 {
508 $this->begin();
509 if ( $this->isConnected() )
510 {
511 if ( is_array( $table ) )
512 {
513 $lockQuery = "LOCK TABLE";
514 $first = true;
515 foreach( array_keys( $table ) as $tableKey )
516 {
517 if ( $first == true )
518 $first = false;
519 else
520 $lockQuery .= ",";
521 $lockQuery .= " " . $table[$tableKey]['table'];
522 }
523 $this->query( $lockQuery );
524 }
525 else
526 {
527 $this->query( "LOCK TABLE $table" );
528 }
529 }
530 }
531
532 function unlock()
533 {
534 $this->commit();
535 }
536
540 function beginQuery()
541 {
542 return $this->query("BEGIN WORK");
543 }
544
548 function commitQuery()
549 {
550 return $this->query( "COMMIT WORK" );
551 }
552
556 function rollbackQuery()
557 {
558 return pg_query( $this->DBConnection, "ROLLBACK WORK" );
559 }
560
571 function lastSerialID( $table = false, $column = 'id' )
572 {
573 $id = false;
574
575 if ( $this->isConnected() )
576 {
577 $sql = "SELECT currval( '{$table}_{$column}_seq' )";
578 $result = pg_query( $this->DBConnection, $sql );
579 if ( !$result )
580 {
581 eZDebug::writeError( "Error: error executing query: $sql " . pg_last_error( $this->DBConnection ), "eZPostgreSQLDB" );
582 }
583
584 if ( $result )
585 {
586 $array = pg_fetch_row( $result, 0 );
587 $id = (int)$array[0];
588 }
589 }
590
591 return $id;
592 }
593
594 function setError( )
595 {
596 if ( $this->DBConnection )
597 {
598
599 $this->ErrorMessage = pg_last_error( $this->DBConnection );
600 if ( $this->ErrorMessage != '' )
601 {
602 $this->ErrorNumber = 1;
603 }
604 else
605 {
606 $this->ErrorNumber = 0;
607 }
608
609 }
610 }
611
612 function escapeString( $str )
613 {
614 $str = str_replace("\0", '', $str);
615 $str = pg_escape_string( $this->DBConnection, $str );
616 return $str;
617 }
618
619 function close()
620 {
621 pg_close( $this->DBConnection );
622 }
623
624 function createDatabase( $dbName )
625 {
626 if ( $this->DBConnection != false )
627 {
628 $this->query( "CREATE DATABASE $dbName" );
629 $this->setError();
630 }
631 }
632
633 function removeDatabase( $dbName )
634 {
635 if ( $this->DBConnection != false )
636 {
637 $this->query( "DROP DATABASE $dbName" );
638 $this->setError();
639 }
640 }
641
642 function isCharsetSupported( $charset )
643 {
644 return true;
645 }
646
647 function databaseServerVersion()
648 {
649 if ( $this->isConnected() )
650 {
651 $sql = "SELECT version()";
652 $result = pg_query( $this->DBConnection, $sql );
653 if ( !$result )
654 {
655 eZDebug::writeError( "Error: error executing query: $sql " . pg_last_error( $this->DBConnection ), "eZPostgreSQLDB" );
656 }
657
658 if ( $result )
659 {
660 $array = pg_fetch_row( $result, 0 );
661 $versionText = $array[0];
662 }
663 list( $dbType, $versionInfo ) = explode( ' ', $versionText );
664 $versionArray = explode( '.', $versionInfo );
665 return array( 'string' => $versionInfo,
666 'values' => $versionArray );
667 }
668 return false;
669 }
670
674 function correctSequenceValues()
675 {
676 if ( $this->isConnected() )
677 {
678 $rows = $this->arrayQuery( "SELECT pg_class.relname AS table, pg_attribute.attname AS column
679 FROM pg_class,pg_attribute,pg_attrdef
680 WHERE pg_attrdef.adsrc LIKE 'nextval(%'
681 AND pg_attrdef.adrelid=pg_attribute.attrelid
682 AND pg_attrdef.adnum=pg_attribute.attnum
683 AND pg_attribute.attrelid=pg_class.oid" );
684 foreach ( $rows as $row )
685 {
686 $this->query( "SELECT setval('".$row['table'].'_'.$row['column']."_seq', max(".$row['column'].")) from ".$row['table'] );
687 }
688 return true;
689 }
690 return false;
691 }
692
694
695 }
696
697 ?>
eZDBInterface
Definition: ezdbinterface.php:20
eZDBInterface\startTimer
startTimer()
Definition: ezdbinterface.php:380
eZDBInterface\RELATION_INDEX
const RELATION_INDEX
Definition: ezdbinterface.php:29
eZDBInterface\reportQuery
reportQuery( $class, $sql, $numRows, $timeTaken, $asDebug=false)
Definition: ezdbinterface.php:353
eZDBInterface\RELATION_TABLE_BIT
const RELATION_TABLE_BIT
Definition: ezdbinterface.php:31
eZDBInterface\$Port
$Port
Definition: ezdbinterface.php:1581
eZDBInterface\commit
commit()
Definition: ezdbinterface.php:785
eZDBInterface\BINDING_NO
const BINDING_NO
Definition: ezdbinterface.php:21
eZDBInterface\reportError
reportError()
Definition: ezdbinterface.php:1042
eZDBInterface\connectRetryCount
connectRetryCount()
Definition: ezdbinterface.php:458
eZDBInterface\SERVER_MASTER
const SERVER_MASTER
Definition: ezdbinterface.php:42
eZDBInterface\RELATION_TABLE
const RELATION_TABLE
Definition: ezdbinterface.php:25
eZDBInterface\begin
begin()
Definition: ezdbinterface.php:710
eZDBInterface\$Password
$Password
Definition: ezdbinterface.php:1629
eZDBInterface\RELATION_TRIGGER_BIT
const RELATION_TRIGGER_BIT
Definition: ezdbinterface.php:33
eZDBInterface\ERROR_MISSING_EXTENSION
const ERROR_MISSING_EXTENSION
Definition: ezdbinterface.php:40
eZDBInterface\$User
$User
Definition: ezdbinterface.php:1621
eZDBInterface\RELATION_SEQUENCE
const RELATION_SEQUENCE
Definition: ezdbinterface.php:26
eZDBInterface\RELATION_VIEW
const RELATION_VIEW
Definition: ezdbinterface.php:28
eZDBInterface\RELATION_TRIGGER
const RELATION_TRIGGER
Definition: ezdbinterface.php:27
eZDBInterface\connectRetryWaitTime
connectRetryWaitTime()
Definition: ezdbinterface.php:468
eZDBInterface\$DB
$DB
Definition: ezdbinterface.php:1597
eZDBInterface\isConnected
isConnected()
Definition: ezdbinterface.php:1304
eZDBInterface\RELATION_INDEX_BIT
const RELATION_INDEX_BIT
Definition: ezdbinterface.php:35
eZDBInterface\$Server
$Server
Definition: ezdbinterface.php:1573
eZDBInterface\RELATION_SEQUENCE_BIT
const RELATION_SEQUENCE_BIT
Definition: ezdbinterface.php:32
eZDBInterface\RELATION_VIEW_BIT
const RELATION_VIEW_BIT
Definition: ezdbinterface.php:34
eZDBInterface\timeTaken
timeTaken()
Definition: ezdbinterface.php:426
eZDBInterface\endTimer
endTimer()
Definition: ezdbinterface.php:390
eZDBInterface\relationName
relationName( $relationType)
Definition: ezdbinterface.php:1206
eZDB\ERROR_HANDLING_EXCEPTIONS
const ERROR_HANDLING_EXCEPTIONS
Definition: ezdb.php:361
eZDebugSetting\writeDebug
static writeDebug( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:127
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\HANDLE_EXCEPTION
const HANDLE_EXCEPTION
Definition: ezdebug.php:77
eZDebug\createAccumulatorGroup
static createAccumulatorGroup( $key, $name=false)
Definition: ezdebug.php:1314
eZDebug\setHandleType
static setHandleType( $type)
Definition: ezdebug.php:247
eZDebug\writeWarning
static writeWarning( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:502
eZDebug\accumulatorStart
static accumulatorStart( $key, $inGroup=false, $name=false, $recursive=false)
Definition: ezdebug.php:1361
eZDebug\accumulatorStop
static accumulatorStop( $key, $recursive=false)
Definition: ezdebug.php:1389
eZPostgreSQLDB
The eZPostgreSQLDB class provides PostgreSQL database functions.
Definition: ezpostgresqldb.php:21
eZPostgreSQLDB\arrayQuery
arrayQuery( $sql, $params=array(), $server=false)
Definition: ezpostgresqldb.php:244
eZPostgreSQLDB\bindingType
bindingType()
Definition: ezpostgresqldb.php:181
eZPostgreSQLDB\query
query( $sql, $server=false)
Definition: ezpostgresqldb.php:191
eZPostgreSQLDB\setError
setError()
Definition: ezpostgresqldb.php:594
eZPostgreSQLDB\relationCount
relationCount( $relationType=eZDBInterface::RELATION_TABLE)
Definition: ezpostgresqldb.php:419
eZPostgreSQLDB\eZTableList
eZTableList( $server=eZDBInterface::SERVER_MASTER)
Definition: ezpostgresqldb.php:467
eZPostgreSQLDB\relationKind
relationKind( $relationType)
Definition: ezpostgresqldb.php:367
eZPostgreSQLDB\relationCounts
relationCounts( $relationMask)
Definition: ezpostgresqldb.php:379
eZPostgreSQLDB\availableDatabases
availableDatabases()
Definition: ezpostgresqldb.php:156
eZPostgreSQLDB\databaseServerVersion
databaseServerVersion()
Definition: ezpostgresqldb.php:647
eZPostgreSQLDB\supportedRelationTypes
supportedRelationTypes()
Definition: ezpostgresqldb.php:355
eZPostgreSQLDB\lastSerialID
lastSerialID( $table=false, $column='id')
Definition: ezpostgresqldb.php:571
eZPostgreSQLDB\relationList
relationList( $relationType=eZDBInterface::RELATION_TABLE)
Definition: ezpostgresqldb.php:443
eZPostgreSQLDB\unlock
unlock()
Definition: ezpostgresqldb.php:532
eZPostgreSQLDB\escapeString
escapeString( $str)
Definition: ezpostgresqldb.php:612
eZPostgreSQLDB\removeDatabase
removeDatabase( $dbName)
Definition: ezpostgresqldb.php:633
eZPostgreSQLDB\subString
subString( $string, $from, $len=null)
Definition: ezpostgresqldb.php:323
eZPostgreSQLDB\createDatabase
createDatabase( $dbName)
Definition: ezpostgresqldb.php:624
eZPostgreSQLDB\removeRelation
removeRelation( $relationName, $relationType)
Definition: ezpostgresqldb.php:489
eZPostgreSQLDB\correctSequenceValues
correctSequenceValues()
Definition: ezpostgresqldb.php:674
eZPostgreSQLDB\bindVariable
bindVariable( $value, $fieldDef=false)
Definition: ezpostgresqldb.php:186
eZPostgreSQLDB\commitQuery
commitQuery()
Definition: ezpostgresqldb.php:548
eZPostgreSQLDB\__construct
__construct( $parameters)
Definition: ezpostgresqldb.php:28
eZPostgreSQLDB\rollbackQuery
rollbackQuery()
Definition: ezpostgresqldb.php:556
eZPostgreSQLDB\lock
lock( $table)
Definition: ezpostgresqldb.php:506
eZPostgreSQLDB\beginQuery
beginQuery()
Definition: ezpostgresqldb.php:540
eZPostgreSQLDB\relationMatchRegexp
relationMatchRegexp( $relationType)
Definition: ezpostgresqldb.php:484
eZPostgreSQLDB\close
close()
Definition: ezpostgresqldb.php:619
eZPostgreSQLDB\databaseName
databaseName()
Definition: ezpostgresqldb.php:176
eZPostgreSQLDB\concatString
concatString( $strings=array())
Definition: ezpostgresqldb.php:335
eZPostgreSQLDB\supportedRelationTypeMask
supportedRelationTypeMask()
Definition: ezpostgresqldb.php:346
eZPostgreSQLDB\isCharsetSupported
isCharsetSupported( $charset)
Definition: ezpostgresqldb.php:642
eZPostgreSQLDB\connectString
static connectString( $server=null, $port=null, $db=null, $user=null, $password=null)
Definition: ezpostgresqldb.php:139
eZPostgreSQLDB\md5
md5( $str)
Definition: ezpostgresqldb.php:341
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.