PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <signal.h>
#include <sys/stat.h>
#include <unistd.h>
#include "common.h"
#include "common/logging.h"
#include "copy.h"
#include "libpq-fe.h"
#include "pqexpbuffer.h"
#include "prompt.h"
#include "settings.h"
#include "stringutils.h"
Go to the source code of this file.
Data Structures | |
struct | copy_options |
Macros | |
#define | COPYBUFSIZ 8192 |
Functions | |
static void | free_copy_options (struct copy_options *ptr) |
static void | xstrcat (char **var, const char *more) |
static struct copy_options * | parse_slash_copy (const char *args) |
bool | do_copy (const char *args) |
bool | handleCopyOut (PGconn *conn, FILE *copystream, PGresult **res) |
bool | handleCopyIn (PGconn *conn, FILE *copystream, bool isbinary, PGresult **res) |
bool do_copy | ( | const char * | args | ) |
Definition at line 268 of file copy.c.
References appendPQExpBufferStr(), generate_unaccent_rules::args, canonicalize_path(), _psqlSettings::copyStream, _psqlSettings::cur_cmd_source, PQExpBufferData::data, disable_sigpipe_trap(), fflush(), free, free_copy_options(), fstat, initPQExpBuffer(), options, parse_slash_copy(), PG_BINARY_R, PG_BINARY_W, pg_log_error, printfPQExpBuffer(), pset, _psqlSettings::queryFout, restore_sigpipe_trap(), S_ISDIR, SendQuery(), SetShellResultVariables(), stat::st_mode, generate_unaccent_rules::stdout, success, termPQExpBuffer(), and wait_result_to_str().
Referenced by exec_command_copy().
|
static |
Definition at line 65 of file copy.c.
References copy_options::after_tofrom, copy_options::before_tofrom, copy_options::file, and free.
Referenced by do_copy(), and parse_slash_copy().
Definition at line 511 of file copy.c.
References _, buf, conn, COPYBUFSIZ, _psqlSettings::cur_cmd_source, fflush(), get_prompt(), _psqlSettings::lineno, pg_log_info, PGRES_COMMAND_OK, PGRES_COPY_IN, PQclear(), PQerrorMessage(), PQgetResult(), PQprotocolVersion(), PQputCopyData(), PQputCopyEnd(), PQresultStatus(), PROMPT_COPY, pset, _psqlSettings::quiet, res, sigint_interrupt_enabled, sigint_interrupt_jmp, generate_unaccent_rules::stdout, and _psqlSettings::stmt_lineno.
Referenced by HandleCopyResult().
Definition at line 434 of file copy.c.
References buf, conn, fflush(), pg_log_error, pg_log_info, PGRES_COMMAND_OK, PQerrorMessage(), PQfreemem(), PQgetCopyData(), PQgetResult(), PQresultStatus(), and res.
Referenced by HandleCopyResult().
|
static |
Definition at line 89 of file copy.c.
References copy_options::after_tofrom, generate_unaccent_rules::args, copy_options::before_tofrom, _psqlSettings::encoding, error(), expand_tilde(), copy_options::file, free_copy_options(), copy_options::from, pg_log_error, pg_malloc0(), pg_strcasecmp(), pg_strdup(), copy_options::program, pset, copy_options::psql_inout, standard_strings(), strip_quotes(), strtokx(), token, and xstrcat().
Referenced by do_copy().
|
static |
Definition at line 78 of file copy.c.
References free, and psprintf().
Referenced by parse_slash_copy().