ID: 18747 Comment by: jc at mega-bucks dot co dot jp Reported By: vincent at sunlight dot tmfweb dot nl Status: Assigned Bug Type: Documentation problem Operating System: Linux PHP Version: 4.2.2 Assigned To: yohgaki New Comment:
When will the documentation be updated? This bug report has been open for 10 months now ... The documentation clearly states that we should be using this function instead of the *old* pg_last_error(): http://jp.php.net/manual/en/function.pg-last-error.php Use pg_result_error(), pg_result_status() and pg_connection_status() for better error handling. But as the first person who reported this bug noted, the current implementation of this function is useless. You can't pass it a valid ressource identifier because pg_query() returns false on failure. Having a valid bug report open for almost one year is a bit too long .... I really want to use this function as it seems very useful and more robust than pg_last_error() but I can't figure out at all how to use it ... Previous Comments: ------------------------------------------------------------------------ [2002-08-07 03:12:12] [EMAIL PROTECTED] Looks like I need to explain how it could be useful. If you cannot wait, read libpq manual. ------------------------------------------------------------------------ [2002-08-05 17:58:17] vincent at sunlight dot tmfweb dot nl The function pg_result_error() supposedly gives the error message for some failed SQL query after calling pg_query() with that query. It must be given a resource identifier of the result to get the error message for that result (sounds alright). However, function pg_query() returns FALSE if a query failed instead of a result identifier, so what can possibly be passed to pq_result_error() in this case? The query certainly went wrong, but there's no way to check exactly what, as there is no resource identifier... Almost looks like a Catch 22. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18747&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php