. ' WHERE relkind = \'r\''
. ' AND nspname = ' . $this->addQuotes( $this->getCoreSchema() )
. ' AND relname = ' . $this->addQuotes( $oldName )
- . ' AND adsrc LIKE \'nextval(%\'',
+ . ' AND pg_get_expr(adbin, adrelid) LIKE \'nextval(%\'',
$fname
);
$row = $this->fetchObject( $res );
}
$oid = $this->fetchObject( $res )->oid;
- $res = $this->query( 'SELECT adsrc FROM pg_attribute a'
+ $res = $this->query( 'SELECT pg_get_expr(adbin, adrelid) AS adsrc FROM pg_attribute a'
. ' JOIN pg_attrdef d ON (a.attrelid=d.adrelid and a.attnum=d.adnum)'
. " WHERE a.attrelid = $oid"
- . ' AND adsrc LIKE \'nextval(%\'',
+ . ' AND pg_get_expr(adbin, adrelid) LIKE \'nextval(%\'',
$fname
);
$row = $this->fetchObject( $res );
* @return string[]
*/
private function pg_array_parse( $text, &$output, $limit = false, $offset = 1 ) {
- if ( false === $limit ) {
+ if ( $limit === false ) {
$limit = strlen( $text ) - 1;
$output = [];
}
- if ( '{}' == $text ) {
+ if ( $text == '{}' ) {
return $output;
}
do {
- if ( '{' != $text[$offset] ) {
+ if ( $text[$offset] != '{' ) {
preg_match( "/(\\{?\"([^\"\\\\]|\\\\.)*\"|[^,{}]+)+([,}]+)/",
$text, $match, 0, $offset );
$offset += strlen( $match[0] );
- $output[] = ( '"' != $match[1][0]
+ $output[] = ( $match[1][0] != '"'
? $match[1]
: stripcslashes( substr( $match[1], 1, -1 ) ) );
- if ( '},' == $match[3] ) {
+ if ( $match[3] == '},' ) {
return $output;
}
} else {