Edit report at https://bugs.php.net/bug.php?id=31021&edit=1

 ID:                 31021
 Updated by:         yohg...@php.net
 Reported by:        ppo at beeznest dot net
-Summary:            pg_result_notice
+Summary:            pg_result_notice() is needed to get all notice
                     messages.
-Status:             Open
+Status:             Assigned
 Type:               Feature/Change Request
 Package:            PostgreSQL related
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        yohgaki
 Block user comment: N
 Private report:     N

 New Comment:

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;
        
        TSRMLS_FETCH();
        if (! PGG(ignore_notices)) {
                notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
                notice->message = _php_pgsql_trim_message(message, (int 
*)&notice->len);
                if (PGG(log_notices)) {
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice-
>message);
                }
                zend_hash_index_update(&PGG(notices), (ulong)resource_id, (void 
**)&notice, sizeof(php_pgsql_notice *), NULL);
        }
}
/* }}} */


Nested hash for notices is required.


Previous Comments:
------------------------------------------------------------------------
[2004-12-08 15:00:47] 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.

------------------------------------------------------------------------
[2004-12-08 14:52:35] tony2...@php.net

pg_last_notice() - is that what you need ?

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

Description:
------------
Hi,

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?

Thanks,
Pascal



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=31021&edit=1

Reply via email to