PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <ctype.h>
#include <limits.h>
#include <sys/time.h>
#include <unistd.h>
#include "libpq-fe.h"
#include "libpq-int.h"
#include "port/pg_bswap.h"
Go to the source code of this file.
Functions | |
void | PQtrace (PGconn *conn, FILE *debug_port) |
void | PQuntrace (PGconn *conn) |
void | PQsetTraceFlags (PGconn *conn, int flags) |
static void | pqTraceFormatTimestamp (char *timestr, size_t ts_len) |
static void | pqTraceOutputByte1 (FILE *pfdebug, const char *data, int *cursor) |
static int | pqTraceOutputInt16 (FILE *pfdebug, const char *data, int *cursor) |
static int | pqTraceOutputInt32 (FILE *pfdebug, const char *data, int *cursor, bool suppress) |
static void | pqTraceOutputString (FILE *pfdebug, const char *data, int *cursor, bool suppress) |
static void | pqTraceOutputNchar (FILE *pfdebug, int len, const char *data, int *cursor, bool suppress) |
static void | pqTraceOutput_NotificationResponse (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_Bind (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_Close (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_CommandComplete (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_CopyData (FILE *f, const char *message, int *cursor, int length, bool suppress) |
static void | pqTraceOutput_DataRow (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_Describe (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutputNR (FILE *f, const char *type, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_ErrorResponse (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_NoticeResponse (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_Execute (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_CopyFail (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_GSSResponse (FILE *f, const char *message, int *cursor, int length, bool regress) |
static void | pqTraceOutput_PasswordMessage (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_SASLInitialResponse (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_SASLResponse (FILE *f, const char *message, int *cursor, int length, bool regress) |
static void | pqTraceOutput_FunctionCall (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_CopyInResponse (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_CopyOutResponse (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_BackendKeyData (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_Parse (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_Query (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_Authentication (FILE *f, const char *message, int *cursor, int length, bool suppress) |
static void | pqTraceOutput_ParameterStatus (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_ParameterDescription (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_RowDescription (FILE *f, const char *message, int *cursor, bool regress) |
static void | pqTraceOutput_NegotiateProtocolVersion (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_FunctionCallResponse (FILE *f, const char *message, int *cursor) |
static void | pqTraceOutput_CopyBothResponse (FILE *f, const char *message, int *cursor, int length) |
static void | pqTraceOutput_ReadyForQuery (FILE *f, const char *message, int *cursor) |
void | pqTraceOutputMessage (PGconn *conn, const char *message, bool toServer) |
void | pqTraceOutputNoTypeByteMessage (PGconn *conn, const char *message) |
void | pqTraceOutputCharResponse (PGconn *conn, const char *responseType, char response) |
void PQsetTraceFlags | ( | PGconn * | conn, |
int | flags | ||
) |
Definition at line 64 of file fe-trace.c.
References conn, pg_conn::Pfdebug, and pg_conn::traceFlags.
Referenced by main().
void PQtrace | ( | PGconn * | conn, |
FILE * | debug_port | ||
) |
Definition at line 35 of file fe-trace.c.
References conn, pg_conn::Pfdebug, PQuntrace(), and pg_conn::traceFlags.
Referenced by main().
|
static |
Definition at line 80 of file fe-trace.c.
References gettimeofday(), now(), snprintf, and tm.
Referenced by pqTraceOutputCharResponse(), pqTraceOutputMessage(), and pqTraceOutputNoTypeByteMessage().
|
static |
Definition at line 484 of file fe-trace.c.
References AUTH_REQ_GSS, AUTH_REQ_GSS_CONT, AUTH_REQ_MD5, AUTH_REQ_OK, AUTH_REQ_PASSWORD, AUTH_REQ_SASL, AUTH_REQ_SASL_CONT, AUTH_REQ_SASL_FIN, AUTH_REQ_SSPI, fprintf, pg_ntoh32, pqTraceOutputNchar(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 455 of file fe-trace.c.
References fprintf, and pqTraceOutputInt32().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 240 of file fe-trace.c.
References fprintf, i, pqTraceOutputInt16(), pqTraceOutputInt32(), pqTraceOutputNchar(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 270 of file fe-trace.c.
References fprintf, pqTraceOutputByte1(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 278 of file fe-trace.c.
References fprintf, and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 598 of file fe-trace.c.
References fprintf, pqTraceOutputByte1(), and pqTraceOutputInt16().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 285 of file fe-trace.c.
References fprintf, and pqTraceOutputNchar().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 360 of file fe-trace.c.
References fprintf, and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 429 of file fe-trace.c.
References fprintf, i, pqTraceOutputByte1(), and pqTraceOutputInt16().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 442 of file fe-trace.c.
References fprintf, i, pqTraceOutputByte1(), and pqTraceOutputInt16().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 293 of file fe-trace.c.
References fprintf, i, len, pqTraceOutputInt16(), pqTraceOutputInt32(), and pqTraceOutputNchar().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 311 of file fe-trace.c.
References fprintf, pqTraceOutputByte1(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 340 of file fe-trace.c.
References pqTraceOutputNR().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 352 of file fe-trace.c.
References fprintf, pqTraceOutputInt32(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 403 of file fe-trace.c.
References fprintf, i, pqTraceOutputInt16(), pqTraceOutputInt32(), and pqTraceOutputNchar().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 587 of file fe-trace.c.
References fprintf, len, pqTraceOutputInt32(), and pqTraceOutputNchar().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 367 of file fe-trace.c.
References fprintf, and pqTraceOutputNchar().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 579 of file fe-trace.c.
References fprintf, and pqTraceOutputInt32().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 346 of file fe-trace.c.
References pqTraceOutputNR().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 231 of file fe-trace.c.
References fprintf, pqTraceOutputInt32(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 547 of file fe-trace.c.
References fprintf, i, pqTraceOutputInt16(), and pqTraceOutputInt32().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 539 of file fe-trace.c.
References fprintf, and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 463 of file fe-trace.c.
References fprintf, i, pqTraceOutputInt16(), pqTraceOutputInt32(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 375 of file fe-trace.c.
References fprintf, and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 477 of file fe-trace.c.
References fprintf, and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 608 of file fe-trace.c.
References fprintf, and pqTraceOutputByte1().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 559 of file fe-trace.c.
References fprintf, i, pqTraceOutputInt16(), pqTraceOutputInt32(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 382 of file fe-trace.c.
References fprintf, pqTraceOutputInt32(), pqTraceOutputNchar(), and pqTraceOutputString().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 395 of file fe-trace.c.
References fprintf, and pqTraceOutputNchar().
Referenced by pqTraceOutputMessage().
|
static |
Definition at line 107 of file fe-trace.c.
Referenced by pqTraceOutput_Close(), pqTraceOutput_CopyBothResponse(), pqTraceOutput_CopyInResponse(), pqTraceOutput_CopyOutResponse(), pqTraceOutput_Describe(), pqTraceOutput_ReadyForQuery(), and pqTraceOutputNR().
void pqTraceOutputCharResponse | ( | PGconn * | conn, |
const char * | responseType, | ||
char | response | ||
) |
Definition at line 909 of file fe-trace.c.
References conn, fprintf, pg_conn::Pfdebug, PQTRACE_SUPPRESS_TIMESTAMPS, pqTraceFormatTimestamp(), and pg_conn::traceFlags.
Referenced by PQconnectPoll().
|
static |
Definition at line 126 of file fe-trace.c.
References data, fprintf, and pg_ntoh16.
Referenced by pqTraceOutput_Bind(), pqTraceOutput_CopyBothResponse(), pqTraceOutput_CopyInResponse(), pqTraceOutput_CopyOutResponse(), pqTraceOutput_DataRow(), pqTraceOutput_FunctionCall(), pqTraceOutput_ParameterDescription(), pqTraceOutput_Parse(), pqTraceOutput_RowDescription(), and pqTraceOutputNoTypeByteMessage().
|
static |
Definition at line 145 of file fe-trace.c.
References data, fprintf, and pg_ntoh32.
Referenced by pqTraceOutput_BackendKeyData(), pqTraceOutput_Bind(), pqTraceOutput_DataRow(), pqTraceOutput_Execute(), pqTraceOutput_FunctionCall(), pqTraceOutput_FunctionCallResponse(), pqTraceOutput_NegotiateProtocolVersion(), pqTraceOutput_NotificationResponse(), pqTraceOutput_ParameterDescription(), pqTraceOutput_Parse(), pqTraceOutput_RowDescription(), pqTraceOutput_SASLInitialResponse(), and pqTraceOutputNoTypeByteMessage().
Definition at line 618 of file fe-trace.c.
References Assert, AUTH_RESPONSE_GSS, AUTH_RESPONSE_PASSWORD, AUTH_RESPONSE_SASL, AUTH_RESPONSE_SASL_INITIAL, conn, pg_conn::current_auth_response, fprintf, pg_conn::Pfdebug, pg_ntoh32, PqMsg_AuthenticationRequest, PqMsg_BackendKeyData, PqMsg_Bind, PqMsg_BindComplete, PqMsg_Close, PqMsg_CloseComplete, PqMsg_CommandComplete, PqMsg_CopyBothResponse, PqMsg_CopyData, PqMsg_CopyDone, PqMsg_CopyFail, PqMsg_CopyInResponse, PqMsg_CopyOutResponse, PqMsg_DataRow, PqMsg_Describe, PqMsg_EmptyQueryResponse, PqMsg_ErrorResponse, PqMsg_Execute, PqMsg_Flush, PqMsg_FunctionCall, PqMsg_FunctionCallResponse, PqMsg_GSSResponse, PqMsg_NegotiateProtocolVersion, PqMsg_NoData, PqMsg_NoticeResponse, PqMsg_NotificationResponse, PqMsg_ParameterDescription, PqMsg_ParameterStatus, PqMsg_Parse, PqMsg_ParseComplete, PqMsg_PasswordMessage, PqMsg_PortalSuspended, PqMsg_Query, PqMsg_ReadyForQuery, PqMsg_RowDescription, PqMsg_SASLInitialResponse, PqMsg_SASLResponse, PqMsg_Sync, PqMsg_Terminate, PQTRACE_REGRESS_MODE, PQTRACE_SUPPRESS_TIMESTAMPS, pqTraceFormatTimestamp(), pqTraceOutput_Authentication(), pqTraceOutput_BackendKeyData(), pqTraceOutput_Bind(), pqTraceOutput_Close(), pqTraceOutput_CommandComplete(), pqTraceOutput_CopyBothResponse(), pqTraceOutput_CopyData(), pqTraceOutput_CopyFail(), pqTraceOutput_CopyInResponse(), pqTraceOutput_CopyOutResponse(), pqTraceOutput_DataRow(), pqTraceOutput_Describe(), pqTraceOutput_ErrorResponse(), pqTraceOutput_Execute(), pqTraceOutput_FunctionCall(), pqTraceOutput_FunctionCallResponse(), pqTraceOutput_GSSResponse(), pqTraceOutput_NegotiateProtocolVersion(), pqTraceOutput_NoticeResponse(), pqTraceOutput_NotificationResponse(), pqTraceOutput_ParameterDescription(), pqTraceOutput_ParameterStatus(), pqTraceOutput_Parse(), pqTraceOutput_PasswordMessage(), pqTraceOutput_Query(), pqTraceOutput_ReadyForQuery(), pqTraceOutput_RowDescription(), pqTraceOutput_SASLInitialResponse(), pqTraceOutput_SASLResponse(), and pg_conn::traceFlags.
Referenced by pg_password_sendauth(), pg_SASL_continue(), pg_SASL_init(), pqParseDone(), and pqPutMsgEnd().
|
static |
Definition at line 193 of file fe-trace.c.
References data, fprintf, i, len, and next.
Referenced by pqTraceOutput_Authentication(), pqTraceOutput_Bind(), pqTraceOutput_CopyData(), pqTraceOutput_DataRow(), pqTraceOutput_FunctionCall(), pqTraceOutput_FunctionCallResponse(), pqTraceOutput_GSSResponse(), pqTraceOutput_SASLInitialResponse(), and pqTraceOutput_SASLResponse().
void pqTraceOutputNoTypeByteMessage | ( | PGconn * | conn, |
const char * | message | ||
) |
Definition at line 835 of file fe-trace.c.
References CANCEL_REQUEST_CODE, conn, fprintf, NEGOTIATE_GSS_CODE, NEGOTIATE_SSL_CODE, pg_conn::Pfdebug, pg_ntoh32, PQTRACE_REGRESS_MODE, PQTRACE_SUPPRESS_TIMESTAMPS, pqTraceFormatTimestamp(), pqTraceOutputInt16(), pqTraceOutputInt32(), pqTraceOutputString(), and pg_conn::traceFlags.
Referenced by pqPutMsgEnd().
|
static |
Definition at line 320 of file fe-trace.c.
References fprintf, pqTraceOutputByte1(), pqTraceOutputString(), and type.
Referenced by pqTraceOutput_ErrorResponse(), and pqTraceOutput_NoticeResponse().
|
static |
Definition at line 166 of file fe-trace.c.
References data, fprintf, and len.
Referenced by pqTraceOutput_Authentication(), pqTraceOutput_Bind(), pqTraceOutput_Close(), pqTraceOutput_CommandComplete(), pqTraceOutput_CopyFail(), pqTraceOutput_Describe(), pqTraceOutput_Execute(), pqTraceOutput_NotificationResponse(), pqTraceOutput_ParameterStatus(), pqTraceOutput_Parse(), pqTraceOutput_PasswordMessage(), pqTraceOutput_Query(), pqTraceOutput_RowDescription(), pqTraceOutput_SASLInitialResponse(), pqTraceOutputNoTypeByteMessage(), and pqTraceOutputNR().
void PQuntrace | ( | PGconn * | conn | ) |
Definition at line 49 of file fe-trace.c.
References conn, fflush(), pg_conn::Pfdebug, and pg_conn::traceFlags.
Referenced by PQtrace().