diff options
Diffstat (limited to 'contrib/pg_dumplo/utils.c')
-rw-r--r-- | contrib/pg_dumplo/utils.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/contrib/pg_dumplo/utils.c b/contrib/pg_dumplo/utils.c deleted file mode 100644 index c48db20e94..0000000000 --- a/contrib/pg_dumplo/utils.c +++ /dev/null @@ -1,97 +0,0 @@ -/* ------------------------------------------------------------------------- - * pg_dumplo - * - * $PostgreSQL$ - * - * Karel Zak 1999-2000 - * ------------------------------------------------------------------------- - */ - -#include "postgres_fe.h" - -#include <fcntl.h> -#include <errno.h> -#include <time.h> -#include <unistd.h> -#include <sys/stat.h> - -#include "libpq-fe.h" -#include "libpq/libpq-fs.h" - -#include "pg_dumplo.h" - -extern int errno; - -static void Dummy_NoticeProcessor(void *arg, const char *message); -static void Default_NoticeProcessor(void *arg, const char *message); - - -void -index_file(LODumpMaster * pgLO) -{ - char path[BUFSIZ]; - int sz; - - if (pgLO->action == ACTION_SHOW) - return; - - snprintf(path, BUFSIZ, "%s/%s", pgLO->space, pgLO->db); - - if (pgLO->action == ACTION_EXPORT_ATTR || - pgLO->action == ACTION_EXPORT_ALL) - { - - if (mkdir(path, DIR_UMASK) == -1) - { - if (errno != EEXIST) - { - perror(path); - exit(RE_ERROR); - } - } - - sz = strlen(path); - strncat(path, "/lo_dump.index", BUFSIZ - sz); - - if ((pgLO->index = fopen(path, "w")) == NULL) - { - perror(path); - exit(RE_ERROR); - } - - } - else if (pgLO->action != ACTION_NONE) - { - sz = strlen(path); - strncat(path, "/lo_dump.index", BUFSIZ - sz); - - if ((pgLO->index = fopen(path, "r")) == NULL) - { - perror(path); - exit(RE_ERROR); - } - } -} - -static -void -Dummy_NoticeProcessor(void *arg, const char *message) -{ - ; -} - -static -void -Default_NoticeProcessor(void *arg, const char *message) -{ - fprintf(stderr, "%s", message); -} - -void -notice(LODumpMaster * pgLO, int set) -{ - if (set) - PQsetNoticeProcessor(pgLO->conn, Default_NoticeProcessor, NULL); - else - PQsetNoticeProcessor(pgLO->conn, Dummy_NoticeProcessor, NULL); -} |