php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74781 Add the latest PG_DIAG_* const
Submitted: 2017-06-19 13:44 UTC Modified: 2017-08-17 19:07 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: qschuler at neosyne dot com Assigned: kalle (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 7.2.0alpha1 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: qschuler at neosyne dot com
New email:
PHP Version: OS:

 

 [2017-06-19 13:44 UTC] qschuler at neosyne dot com
Description:
------------
The function pg_result_error_field uses some PGSQL_DIAG_* to get information about an error thrown by the database. The existing constants are:

PG_DIAG_SEVERITY
PG_DIAG_SQLSTATE
PG_DIAG_MESSAGE_PRIMARY
PG_DIAG_MESSAGE_DETAIL
PG_DIAG_MESSAGE_HINT
PG_DIAG_STATEMENT_POSITION
PG_DIAG_INTERNAL_POSITION
PG_DIAG_INTERNAL_QUERY
PG_DIAG_CONTEXT
PG_DIAG_SOURCE_FILE
PG_DIAG_SOURCE_LINE
PG_DIAG_SOURCE_FUNCTION

Some other constants has been added since PostgreSQL 9.3:

PG_DIAG_SCHEMA_NAME
PG_DIAG_TABLE_NAME
PG_DIAG_COLUMN_NAME
PG_DIAG_DATATYPE_NAME
PG_DIAG_CONSTRAINT_NAME

And since PostgreSQL 9.6:

PG_DIAG_SEVERITY_NONLOCALIZED

Could we add the this new constants in order to improve the error messages?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-17 19:07 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2017-08-17 19:07 UTC] kalle@php.net
I implemented these in master (7.3), its all up to the 7.2 RMs if this should be merged
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 31 11:00:02 2025 UTC