Features deprecated in 2.x releases were removed, specifically
ResultSet
class -- useResult
.- Getter / "isser" methods of classes for complex PostgreSQL types, use the properties instead. The methods were
needed previously to support magic readonly properties, now these properties are native
public readonly
and the following methods are removed:types\Circle
:getCenter()
,getRadius()
;types\Line
:getA()
,getB()
,getC()
;types\Path
:isOpen()
;types\Point
:getX()
,getY()
;types\Box
andtypes\LineSegment
:getStart()
,getEnd()
;types\Range
:getLower()
,getUpper()
,isLowerInclusive()
,isUpperInclusive()
,isEmpty()
;types\Tid
:getBlock()
,getTuple()
.
types\ReadOnlyProperties
trait previously used to implement magic readonly properties.converters\BaseConverter::getStrspn()
method.- Methods mentioning
resource
, as pgsql extension in PHP 8.1+ no longer uses resources:Connection::getResource()
-- useConnection::getNative()
;Result::getResource()
,Result::createFromResultResource()
-- useResult::getNative()
andResult::createFromReturnValue()
.
- Methods of
converters\DefaultTypeConverterFactory
that are now part ofconverters\TypeOIDMapper
interface orconverters\CachedTypeOIDMapper
class:findTypeNameForOID()
/findOIDForTypeName()
;isArrayTypeOID()
/isRangeTypeOID()
/isMultiRangeTypeOID()
/isDomainTypeOID()
/isCompositeTypeOID()
/isBaseTypeOID()
;setCompositeTypesCaching()
/getCompositeTypesCaching()
.
Connection::checkRollbackNotNeeded()
method -- useConnection::assertRollbackNotNeeded()
.$params
and$resultTypes
arguments ofPreparedStatement::execute()
. It will now execute the statement using only the previously bound values and passing previously specified result types toResult
.
- SQL error codes are now represented by cases of
SqlState
enum instead ofServerException
class constants. Before:nowtry { // ... } catch (ServerException $e) { if ($e::UNIQUE_VIOLATION === $e->getSqlState()) { // handle unique violation } }
try { // ... } catch (ServerException $e) { if (SqlState::UNIQUE_VIOLATION === $e->getSqlState()) { // handle unique violation } }
- Constructor of classes representing range types, backed by
types\RangeConstructor
interface, now has the fifthbool $empty = false
parameter used to create empty ranges. Custom subclasses oftypes\Range
should be updated accordingly. - Typehints were added for method arguments and return values where not previously possible, specifically
int|string
typehints for methods dealing with OID values:$oid
argument ofTypeConverterFactory::getConverterForTypeOID()
and its implementations,- Return value of
Result::getTableOID()
, - Return value of
converters\TypeOIDMapper::findOIDForTypeName()
and its implementations, $oid
argument offindTypeNameForOID()
,isBaseTypeOID()
, andisCompositeTypeOID()
methods inconverters\TypeOIDMapper
and their implementations,$oid
and$baseTypeOid
arguments forisArrayTypeOID()
,isDomainTypeOID()
,isRangeTypeOID()
, andisMultiRangeTypeOID()
methods inconverters\TypeOIDMapper
and their implementations.
int|string
typehints for$fieldIndex
arguments ofsetType()
,fetchColumn()
, andgetTableOID()
methods inResult
class,int|string|null
typehint for$keyColumn
argument ofResult::fetchAll()
.