2000-11-22 03:00:55 +03:00
|
|
|
/* -------------------------------------------------------------------------
|
2003-01-08 00:42:38 +03:00
|
|
|
* pg_dumplo.h
|
2000-11-22 03:00:55 +03:00
|
|
|
*
|
2003-11-29 22:52:15 +03:00
|
|
|
* $PostgreSQL: pgsql/contrib/pg_dumplo/pg_dumplo.h,v 1.10 2003/11/29 19:51:35 pgsql Exp $
|
2000-11-22 03:00:55 +03:00
|
|
|
*
|
|
|
|
* Karel Zak 1999-2000
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PG_DUMPLO_H
|
|
|
|
#define PG_DUMPLO_H
|
2000-06-15 23:05:22 +04:00
|
|
|
|
2000-11-22 03:00:55 +03:00
|
|
|
#include "postgres_ext.h"
|
2000-06-15 23:05:22 +04:00
|
|
|
|
|
|
|
/* ----------
|
|
|
|
* Define
|
|
|
|
* ----------
|
2001-03-22 07:01:46 +03:00
|
|
|
*/
|
2000-06-15 23:05:22 +04:00
|
|
|
#define QUERY_BUFSIZ (8*1024)
|
|
|
|
#define DIR_UMASK 0755
|
2000-11-22 03:00:55 +03:00
|
|
|
#define FILE_UMASK 0644
|
2000-06-15 23:05:22 +04:00
|
|
|
|
2001-03-22 07:01:46 +03:00
|
|
|
#define TRUE 1
|
2000-06-15 23:05:22 +04:00
|
|
|
#define FALSE 0
|
|
|
|
#define RE_OK 0
|
|
|
|
#define RE_ERROR 1
|
|
|
|
|
|
|
|
#define MAX_TABLE_NAME 128
|
|
|
|
#define MAX_ATTR_NAME 128
|
|
|
|
|
2000-11-22 03:00:55 +03:00
|
|
|
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
|
2000-06-15 23:05:22 +04:00
|
|
|
|
|
|
|
/* ----------
|
|
|
|
* LO struct
|
|
|
|
* ----------
|
|
|
|
*/
|
2001-03-22 07:01:46 +03:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *lo_table,
|
|
|
|
*lo_attr;
|
|
|
|
Oid lo_oid;
|
2001-11-05 20:46:40 +03:00
|
|
|
} LOlist;
|
2000-06-15 23:05:22 +04:00
|
|
|
|
2001-03-22 07:01:46 +03:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int action;
|
|
|
|
LOlist *lolist;
|
|
|
|
char **argv,
|
|
|
|
*user,
|
|
|
|
*db,
|
|
|
|
*host,
|
2001-11-12 20:44:14 +03:00
|
|
|
*port,
|
2001-03-22 07:01:46 +03:00
|
|
|
*space;
|
|
|
|
FILE *index;
|
|
|
|
int counter,
|
|
|
|
argc,
|
|
|
|
lolist_start,
|
|
|
|
remove,
|
|
|
|
quiet;
|
|
|
|
PGresult *res;
|
|
|
|
PGconn *conn;
|
2001-11-05 20:46:40 +03:00
|
|
|
} LODumpMaster;
|
2000-06-15 23:05:22 +04:00
|
|
|
|
2001-03-22 07:01:46 +03:00
|
|
|
typedef enum
|
|
|
|
{
|
2001-10-28 09:26:15 +03:00
|
|
|
ACTION_NONE,
|
|
|
|
ACTION_SHOW,
|
|
|
|
ACTION_EXPORT_ATTR,
|
|
|
|
ACTION_EXPORT_ALL,
|
|
|
|
ACTION_IMPORT
|
2001-11-05 20:46:40 +03:00
|
|
|
} PGLODUMP_ACTIONS;
|
2000-06-15 23:05:22 +04:00
|
|
|
|
2000-11-22 03:00:55 +03:00
|
|
|
extern char *progname;
|
|
|
|
|
2001-03-22 07:01:46 +03:00
|
|
|
extern void notice(LODumpMaster * pgLO, int set);
|
|
|
|
extern void index_file(LODumpMaster * pgLO);
|
|
|
|
extern void load_lolist(LODumpMaster * pgLO);
|
|
|
|
extern void pglo_export(LODumpMaster * pgLO);
|
|
|
|
extern void pglo_import(LODumpMaster * pgLO);
|
2001-10-28 09:26:15 +03:00
|
|
|
|
2001-11-05 20:46:40 +03:00
|
|
|
#endif /* PG_DUMPLO_H */
|