|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <sys/select.h>#include <sys/time.h>#include "catalog/pg_type_d.h"#include "libpq-fe.h"#include "pg_getopt.h"
Go to the source code of this file.
Macros | |
| #define | pg_debug(...) |
| #define | MAXINTLEN 12 |
| #define | MAXINT8LEN 20 |
| #define | pg_fatal(...) pg_fatal_impl(__LINE__, __VA_ARGS__) |
| #define | confirm_result_status(conn, status) confirm_result_status_impl(__LINE__, conn, status) |
| #define | consume_result_status(conn, status) consume_result_status_impl(__LINE__, conn, status) |
| #define | consume_null_result(conn) consume_null_result_impl(__LINE__, conn) |
| #define | consume_query_cancel(conn) consume_query_cancel_impl(__LINE__, conn) |
| #define | send_cancellable_query(conn, monitorConn) send_cancellable_query_impl(__LINE__, conn, monitorConn) |
Enumerations | |
| enum | PipelineInsertStep { BI_BEGIN_TX , BI_DROP_TABLE , BI_CREATE_TABLE , BI_PREPARE , BI_INSERT_ROWS , BI_COMMIT_TX , BI_SYNC , BI_DONE } |
Variables | |
| static const char *const | progname = "libpq_pipeline" |
| static char * | tracefile = NULL |
| static const char *const | drop_table_sql |
| static const char *const | create_table_sql |
| static const char *const | insert_sql |
| static const char *const | insert_sql2 |
| #define confirm_result_status | ( | conn, | |
| status | |||
| ) | confirm_result_status_impl(__LINE__, conn, status) |
Definition at line 94 of file libpq_pipeline.c.
| #define consume_null_result | ( | conn | ) | consume_null_result_impl(__LINE__, conn) |
Definition at line 129 of file libpq_pipeline.c.
| #define consume_query_cancel | ( | conn | ) | consume_query_cancel_impl(__LINE__, conn) |
Definition at line 145 of file libpq_pipeline.c.
| #define consume_result_status | ( | conn, | |
| status | |||
| ) | consume_result_status_impl(__LINE__, conn, status) |
Definition at line 116 of file libpq_pipeline.c.
| #define MAXINT8LEN 20 |
Definition at line 56 of file libpq_pipeline.c.
| #define MAXINTLEN 12 |
Definition at line 55 of file libpq_pipeline.c.
| #define pg_debug | ( | ... | ) |
Definition at line 41 of file libpq_pipeline.c.
| #define pg_fatal | ( | ... | ) | pg_fatal_impl(__LINE__, __VA_ARGS__) |
Definition at line 73 of file libpq_pipeline.c.
| #define send_cancellable_query | ( | conn, | |
| monitorConn | |||
| ) | send_cancellable_query_impl(__LINE__, conn, monitorConn) |
Definition at line 216 of file libpq_pipeline.c.
| enum PipelineInsertStep |
| Enumerator | |
|---|---|
| BI_BEGIN_TX | |
| BI_DROP_TABLE | |
| BI_CREATE_TABLE | |
| BI_PREPARE | |
| BI_INSERT_ROWS | |
| BI_COMMIT_TX | |
| BI_SYNC | |
| BI_DONE | |
Definition at line 924 of file libpq_pipeline.c.
|
static |
Definition at line 96 of file libpq_pipeline.c.
References conn, pg_fatal_impl(), PQerrorMessage(), PQgetResult, PQresStatus(), and PQresultStatus.
Referenced by consume_query_cancel_impl(), and consume_result_status_impl().
|
static |
Definition at line 131 of file libpq_pipeline.c.
References conn, pg_fatal_impl(), PQerrorMessage(), PQgetResult, PQresStatus(), and PQresultStatus.
|
static |
Definition at line 147 of file libpq_pipeline.c.
References confirm_result_status_impl(), conn, PG_DIAG_SQLSTATE, pg_fatal_impl(), PGRES_FATAL_ERROR, PQclear, PQconsumeInput(), PQerrorMessage(), PQisBusy(), and PQresultErrorField.
|
static |
Definition at line 118 of file libpq_pipeline.c.
References confirm_result_status_impl(), conn, and PQclear.
Definition at line 250 of file libpq_pipeline.c.
References conn, CONNECTION_OK, i, JsonPathKeyword::keyword, keywords, opts, pfree(), pg_fatal, pg_malloc(), PQconnectdbParams(), PQconninfo(), PQconninfoFree(), PQerrorMessage(), and PQstatus().
Referenced by test_cancel().
|
static |
Definition at line 59 of file libpq_pipeline.c.
References conn, and PQfinish().
Referenced by main(), test_nosync(), and test_pipelined_insert().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 2117 of file libpq_pipeline.c.
References conn, CONNECTION_OK, exit_nicely(), fprintf, getopt(), optarg, optind, pg_fatal, PG_IOLBF, pg_strdup(), PGRES_COMMAND_OK, PQclear, PQconnectdb(), PQerrorMessage(), PQexec(), PQfinish(), PQresultStatus, PQsetTraceFlags(), PQstatus(), PQtrace(), PQTRACE_REGRESS_MODE, PQTRACE_SUPPRESS_TIMESTAMPS, print_test_list(), generate_unaccent_rules::stdout, test_cancel(), test_disallowed_in_pipeline(), test_multi_pipelines(), test_nosync(), test_pipeline_abort(), test_pipeline_idle(), test_pipelined_insert(), test_prepared(), test_protocol_version(), test_simple_pipeline(), test_singlerowmode(), test_transaction(), test_uniqviol(), tracefile, and usage().
|
static |
Definition at line 1430 of file libpq_pipeline.c.
Referenced by test_pipeline_idle().
|
static |
Definition at line 75 of file libpq_pipeline.c.
References generate_unaccent_rules::args, Assert(), fprintf, progname, generate_unaccent_rules::stdout, and vfprintf.
Referenced by confirm_result_status_impl(), consume_null_result_impl(), consume_query_cancel_impl(), send_cancellable_query_impl(), and wait_for_connection_state().
|
static |
Definition at line 2099 of file libpq_pipeline.c.
References printf.
Referenced by main().
Definition at line 2050 of file libpq_pipeline.c.
References conn, consume_null_result, fprintf, pg_fatal, PGRES_FATAL_ERROR, PGRES_PIPELINE_ABORTED, PGRES_TUPLES_OK, PQclear, PQerrorMessage(), PQgetvalue, PQresStatus(), and PQresultStatus.
Referenced by test_uniqviol().
Definition at line 219 of file libpq_pipeline.c.
References conn, pg_fatal_impl(), PQbackendPID(), PQerrorMessage(), PQsendQueryParams(), and wait_for_connection_state().
|
static |
Definition at line 295 of file libpq_pipeline.c.
References Assert(), cancelConn, conn, CONNECTION_OK, consume_query_cancel, copy_connection(), EINTR, fprintf, pg_debug, pg_fatal, PGRES_POLLING_OK, PGRES_POLLING_READING, PGRES_POLLING_WRITING, PQcancel(), PQcancelBlocking(), PQcancelCreate(), PQcancelErrorMessage(), PQcancelFinish(), PQcancelPoll(), PQcancelReset(), PQcancelSocket(), PQcancelStart(), PQcancelStatus(), PQerrorMessage(), PQfinish(), PQfreeCancel(), PQgetCancel(), PQrequestCancel(), PQsetnonblocking(), PQstatus(), select, and send_cancellable_query.
Referenced by main().
|
static |
Definition at line 460 of file libpq_pipeline.c.
References conn, fprintf, pg_fatal, PGRES_FATAL_ERROR, PGRES_TUPLES_OK, PQ_PIPELINE_OFF, PQclear, PQenterPipelineMode(), PQerrorMessage(), PQexec(), PQexitPipelineMode(), PQisBusy(), PQisnonblocking(), PQpipelineStatus(), PQresultStatus, and PQsendQuery().
Referenced by main().
|
static |
Definition at line 522 of file libpq_pipeline.c.
References conn, consume_null_result, consume_result_status, fprintf, pg_fatal, PGRES_PIPELINE_SYNC, PGRES_TUPLES_OK, PQ_PIPELINE_OFF, PQenterPipelineMode(), PQerrorMessage(), PQexitPipelineMode(), PQpipelineStatus(), PQpipelineSync(), PQsendPipelineSync(), and PQsendQueryParams().
Referenced by main().
|
static |
Definition at line 610 of file libpq_pipeline.c.
References conn, consume_null_result, consume_result_status, exit_nicely(), fprintf, i, pg_fatal, PGRES_TUPLES_OK, PQconsumeInput(), PQenterPipelineMode(), PQerrorMessage(), PQflush(), PQsendFlushRequest(), PQsendQueryParams(), PQsocket(), and select.
Referenced by main().
|
static |
Definition at line 683 of file libpq_pipeline.c.
References conn, consume_null_result, consume_result_status, create_table_sql, drop_table_sql, fprintf, i, insert_sql, PG_DIAG_SQLSTATE, pg_fatal, PGRES_COMMAND_OK, PGRES_FATAL_ERROR, PGRES_PIPELINE_ABORTED, PGRES_PIPELINE_SYNC, PGRES_SINGLE_TUPLE, PGRES_TUPLES_OK, PQ_PIPELINE_ABORTED, PQ_PIPELINE_OFF, PQclear, PQenterPipelineMode(), PQerrorMessage(), PQexec(), PQexitPipelineMode(), PQgetResult, PQgetvalue, PQntuples, PQpipelineStatus(), PQpipelineSync(), PQresStatus(), PQresultErrorField, PQresultStatus, PQsendQueryParams(), PQsetSingleRowMode(), printf, and val.
Referenced by main().
|
static |
Definition at line 1440 of file libpq_pipeline.c.
References conn, consume_null_result, consume_result_status, fprintf, notice_processor(), pg_fatal, PGRES_TUPLES_OK, PQenterPipelineMode(), PQerrorMessage(), PQexitPipelineMode(), PQsendFlushRequest(), PQsendQueryParams(), and PQsetNoticeProcessor().
Referenced by main().
|
static |
Definition at line 937 of file libpq_pipeline.c.
References Assert(), BI_BEGIN_TX, BI_COMMIT_TX, BI_CREATE_TABLE, BI_DONE, BI_DROP_TABLE, BI_INSERT_ROWS, BI_PREPARE, BI_SYNC, conn, create_table_sql, description, drop_table_sql, exit_nicely(), fprintf, insert_sql2, MAXINT8LEN, MAXINTLEN, pg_debug, pg_fatal, PGRES_COMMAND_OK, PGRES_PIPELINE_SYNC, PQclear, PQcmdStatus, PQconsumeInput(), PQenterPipelineMode(), PQerrorMessage(), PQexitPipelineMode(), PQflush(), PQgetResult, PQisBusy(), PQpipelineSync(), PQresStatus(), PQresultStatus, PQsendPrepare(), PQsendQueryParams(), PQsendQueryPrepared(), PQsetnonblocking(), PQsocket(), select, snprintf, and generate_unaccent_rules::stdout.
Referenced by main().
|
static |
Definition at line 1183 of file libpq_pipeline.c.
References confirm_result_status, conn, consume_null_result, consume_result_status, fprintf, i, lengthof, pg_fatal, PGRES_COMMAND_OK, PGRES_FATAL_ERROR, PGRES_PIPELINE_SYNC, PQclear, PQclosePortal(), PQclosePrepared(), PQdescribePortal(), PQdescribePrepared(), PQenterPipelineMode(), PQerrorMessage(), PQexec(), PQexitPipelineMode(), PQftype(), PQnfields, PQpipelineSync(), PQresStatus(), PQresultStatus, PQsendClosePortal(), PQsendClosePrepared(), PQsendDescribePortal(), PQsendDescribePrepared(), and PQsendPrepare().
Referenced by main().
|
static |
Definition at line 1324 of file libpq_pipeline.c.
References conn, CONNECTION_BAD, CONNECTION_OK, i, JsonPathKeyword::keyword, keywords, opts, pfree(), pg_fatal, pg_malloc0(), PQconnectdbParams(), PQconninfo(), PQconninfoFree(), PQerrorMessage(), PQfinish(), PQfullProtocolVersion(), and PQstatus().
Referenced by main().
|
static |
Definition at line 1495 of file libpq_pipeline.c.
References conn, consume_null_result, consume_result_status, fprintf, pg_fatal, PGRES_PIPELINE_SYNC, PGRES_TUPLES_OK, PQ_PIPELINE_OFF, PQenterPipelineMode(), PQerrorMessage(), PQexitPipelineMode(), PQisnonblocking(), PQpipelineStatus(), PQpipelineSync(), and PQsendQueryParams().
Referenced by main().
|
static |
Definition at line 1558 of file libpq_pipeline.c.
References confirm_result_status, conn, consume_null_result, consume_result_status, fprintf, i, pfree(), pg_fatal, PGRES_PIPELINE_SYNC, PGRES_SINGLE_TUPLE, PGRES_TUPLES_CHUNK, PGRES_TUPLES_OK, PQclear, PQenterPipelineMode(), PQerrorMessage(), PQexitPipelineMode(), PQgetResult, PQgetvalue, PQntuples, PQpipelineSync(), PQresStatus(), PQresultStatus, PQsendFlushRequest(), PQsendQueryParams(), PQsetChunkedRowsMode(), PQsetSingleRowMode(), and psprintf().
Referenced by main().
|
static |
Definition at line 1732 of file libpq_pipeline.c.
References conn, consume_null_result, fprintf, i, pg_fatal, PGRES_COMMAND_OK, PGRES_FATAL_ERROR, PGRES_PIPELINE_ABORTED, PGRES_PIPELINE_SYNC, PGRES_TUPLES_OK, PQclear, PQenterPipelineMode(), PQerrorMessage(), PQexec(), PQexitPipelineMode(), PQgetResult, PQgetvalue, PQntuples, PQpipelineSync(), PQresStatus(), PQresultStatus, PQsendPrepare(), PQsendQueryParams(), PQsendQueryPrepared(), and printf.
Referenced by main().
|
static |
Definition at line 1879 of file libpq_pipeline.c.
References conn, EINTR, fprintf, MAXINT8LEN, pg_fatal, PGRES_COMMAND_OK, PQclear, PQconsumeInput(), PQenterPipelineMode(), PQerrorMessage(), PQexec(), PQflush(), PQgetResult, PQisBusy(), PQprepare(), PQresultStatus, PQsendFlushRequest(), PQsendQueryPrepared(), PQsetnonblocking(), PQsocket(), process_result(), select, and sprintf.
Referenced by main().
|
static |
Definition at line 2087 of file libpq_pipeline.c.
References fprintf, and progname.
Referenced by main().
|
static |
Definition at line 167 of file libpq_pipeline.c.
References Assert(), pfree(), pg_fatal_impl(), pg_usleep(), PGRES_TUPLES_OK, PQclear, PQerrorMessage(), PQexecParams(), PQgetvalue, PQnfields, PQntuples, PQresultStatus, psprintf(), and value.
Referenced by send_cancellable_query_impl().
|
static |
Definition at line 46 of file libpq_pipeline.c.
Referenced by test_pipeline_abort(), and test_pipelined_insert().
|
static |
Definition at line 44 of file libpq_pipeline.c.
Referenced by test_pipeline_abort(), and test_pipelined_insert().
|
static |
Definition at line 49 of file libpq_pipeline.c.
Referenced by test_pipeline_abort().
|
static |
Definition at line 51 of file libpq_pipeline.c.
Referenced by test_pipelined_insert().
|
static |
Definition at line 32 of file libpq_pipeline.c.
Referenced by pg_fatal_impl(), and usage().
|
static |
Definition at line 35 of file libpq_pipeline.c.
Referenced by main().