File tree Expand file tree Collapse file tree 6 files changed +28
-2
lines changed Expand file tree Collapse file tree 6 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ PHP NEWS
126
126
. pg_cancel use thread safe PQcancel api instead. (David Carlier)
127
127
. pg_trace new PGSQL_TRACE_SUPPRESS_TIMESTAMPS/PGSQL_TRACE_REGRESS_MODE
128
128
contants support. (David Carlier)
129
+ . pg_set_error_verbosity adding PGSQL_ERRORS_STATE constant. (David Carlier)
129
130
130
131
- Phar:
131
132
. Fix memory leak in phar_rename_archive(). (stkeke)
Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ PHP 8.3 UPGRADE NOTES
220
220
- PGSQL:
221
221
. PGSQL_TRACE_SUPPRESS_TIMESTAMPS.
222
222
. PGSQL_TRACE_REGRESS_MODE.
223
+ . PGSQL_ERRORS_SQLSTATE.
223
224
224
225
- Posix:
225
226
. POSIX_SC_ARG_MAX.
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ char pgsql_libpq_version[16];
112
112
#define PQfreemem free
113
113
#endif
114
114
115
+ #if PG_VERSION_NUM < 120000
116
+ #define PQERRORS_SQLSTATE 0
117
+ #endif
118
+
115
119
ZEND_DECLARE_MODULE_GLOBALS (pgsql )
116
120
static PHP_GINIT_FUNCTION (pgsql );
117
121
@@ -2821,7 +2825,7 @@ PHP_FUNCTION(pg_set_error_verbosity)
2821
2825
2822
2826
pgsql = link -> conn ;
2823
2827
2824
- if (verbosity & (PQERRORS_TERSE |PQERRORS_DEFAULT |PQERRORS_VERBOSE )) {
2828
+ if (verbosity & (PQERRORS_TERSE |PQERRORS_DEFAULT |PQERRORS_VERBOSE | PQERRORS_SQLSTATE )) {
2825
2829
RETURN_LONG (PQsetErrorVerbosity (pgsql , verbosity ));
2826
2830
} else {
2827
2831
RETURN_FALSE ;
Original file line number Diff line number Diff line change 183
183
* @cvalue PQERRORS_VERBOSE
184
184
*/
185
185
const PGSQL_ERRORS_VERBOSE = UNKNOWN ;
186
+ #if PGVERSION_NUM > 110000
187
+ /**
188
+ * @var int
189
+ * @cvalue PQERRORS_SQLSTATE
190
+ */
191
+ const PGSQL_ERRORS_SQLSTATE = UNKNOWN ;
192
+ #else
193
+ /**
194
+ * @var int
195
+ * @cvalue PQERRORS_TERSE
196
+ */
197
+ const PGSQL_ERRORS_SQLSTATE = UNKNOWN ;
198
+ #endif
186
199
187
200
/* For lo_seek() */
188
201
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ if (function_exists('pg_set_error_verbosity')) {
19
19
pg_set_error_verbosity ($ db , PGSQL_ERRORS_TERSE );
20
20
pg_set_error_verbosity ($ db , PGSQL_ERRORS_DEFAULT );
21
21
pg_set_error_verbosity ($ db , PGSQL_ERRORS_VERBOSE );
22
+ pg_set_error_verbosity ($ db , PGSQL_ERRORS_SQLSTATE );
22
23
}
23
24
echo "OK " ;
24
25
?>
You can’t perform that action at this time.
0 commit comments