logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PQgeterror, PQseterror, PQgetErrorField - libpqtypes error system management functions

Author

       A  contribution  of eSilo, LLC. for the PostgreSQL Database Management System.  Written by Andrew Chernow
       and Merlin Moncure.

Description

       The  libpqtypes  library  maintains  a  per-thread global error message.  The error message is managed by
       PQgeterror() and PQseterror().

       PQseterror() takes a regular printf compatible format string for setting the libpqtypes error message.

       PQgetErrorField() gets an error field from the last executed query.  The  error  field  is  only  set  by
       PQparamExec  and  PQparamExecPrepared.   When  using  libpq  functions  that return results, like PQexec,
       continue to use PQresultErrorField.

       To clear the libpqtypes error message, call PQseterror() with a  NULL  format  string:  PQseterror(NULL);
       This will also clear error fields.

Examples

       None.

Name

       PQgeterror, PQseterror, PQgetErrorField - libpqtypes error system management functions

Reporting Bugs

       Report bugs to <libpqtypes@esilo.com>.

Return Value

PQgeterror() returns the last error message for the calling thread.  It will never return NULL.

       PQgetErrorField() returns the error field, referenced by fieldcode, for the last executed query.  NULL is
       returned if no value exists.

See Also

pqt-specs(3)

libpqtypes                                            2011                                         PQgeterror(3)

Synopsis

#include<libpqtypes.h>char*PQgeterror(void);voidPQseterror(constchar*format,...);char*PQgetErrorField(intfieldcode);

See Also