|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #31021 pg_last_notice() is needed to get all notice messages.
Submitted: 2004-12-08 14:44 UTC Modified: 2015-12-18 04:08 UTC
From: ppo at beeznest dot net Assigned: yohgaki (profile)
Status: Closed Package: PostgreSQL related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
18 + 23 = ?
Subscribe to this entry?

 [2004-12-08 14:44 UTC] ppo at beeznest dot net

having the equivalent of pg_result_error for notice messages would be great.
There is also a problem if a query raises several notice messages. Could it be possible to return an array instead of a string, at least if there are several ones?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-08 14:52 UTC]
pg_last_notice() - is that what you need ?
 [2004-12-08 15:00 UTC] ppo at beeznest dot net
No, I mean
  mixed pg_result_notice(resource result)
returning a string if one notice message and an array if several ones.
 [2011-01-01 23:16 UTC]
-Package: Feature/Change Request +Package: PostgreSQL related
 [2013-06-26 21:47 UTC]
-Summary: pg_result_notice +Summary: pg_result_notice() is needed to get all notice messages. -Status: Open +Status: Assigned -Assigned To: +Assigned To: yohgaki
 [2013-06-26 21:47 UTC]
Currently, only the last notice message is stored by pgsql module.

/* {{{ _php_pgsql_notice_handler
static void _php_pgsql_notice_handler(void *resource_id, const char *message)
	php_pgsql_notice *notice;
	if (! PGG(ignore_notices)) {
		notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
		notice->message = _php_pgsql_trim_message(message, (int 
		if (PGG(log_notices)) {
			php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice-
		zend_hash_index_update(&PGG(notices), (ulong)resource_id, (void 
**)&notice, sizeof(php_pgsql_notice *), NULL);
/* }}} */

Nested hash for notices is required.
 [2015-12-16 22:36 UTC]
-Status: Assigned +Status: Closed
 [2015-12-18 04:08 UTC]
-Summary: pg_result_notice() is needed to get all notice messages. +Summary: pg_last_notice() is needed to get all notice messages.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 11:05:48 2023 UTC