diff --git a/contrib/README b/contrib/README index 773b0e30c3..7dcd1ca1fe 100644 --- a/contrib/README +++ b/contrib/README @@ -60,6 +60,9 @@ mSQL-interface - noupdate - trigger to prevent updates on single columns +pg_dumplo - + Dump large objects + soundex - Prototype for soundex function diff --git a/contrib/pg_dumplo/Makefile b/contrib/pg_dumplo/Makefile new file mode 100644 index 0000000000..0d4fb83424 --- /dev/null +++ b/contrib/pg_dumplo/Makefile @@ -0,0 +1,26 @@ + +PROGRAM = pg_dumplo + +OBJECTS = pg_dumplo.o + +CFLAGS = -Wall -fpic -g +CC = gcc +RM = rm -f +INCLUDE = -I/usr/include/postgresql +LIBS =-lpq + +COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDE) +LINK = $(CC) $(CFLAGS) -o $@ $(LIBS) + + +all: $(PROGRAM) + +$(PROGRAM): $(OBJECTS) + $(LINK) $(OBJECTS) + +.c.o: $< + $(COMPILE) -c $< + +clean: + $(RM) -f *~ $(OBJECTS) $(PROGRAM) + diff --git a/contrib/pg_dumplo/README b/contrib/pg_dumplo/README new file mode 100644 index 0000000000..b36cdd01d0 --- /dev/null +++ b/contrib/pg_dumplo/README @@ -0,0 +1,18 @@ + + pg_dumplo - PostgreSQL large object dumper + + + Hmm... documentation is not available. For more information + see the help ( pg_dumplo -h ) and examples in this help. + + Compilation: + - you need the PostgreSQL's devel. libs + - and type: 'make' + + + Karel Zak + + + + + diff --git a/contrib/pg_dumplo/VERSION b/contrib/pg_dumplo/VERSION new file mode 100644 index 0000000000..05b19b1f76 --- /dev/null +++ b/contrib/pg_dumplo/VERSION @@ -0,0 +1 @@ +0.0.4 \ No newline at end of file diff --git a/contrib/pg_dumplo/pg_dumplo.c b/contrib/pg_dumplo/pg_dumplo.c new file mode 100644 index 0000000000..6e6a20bef5 --- /dev/null +++ b/contrib/pg_dumplo/pg_dumplo.c @@ -0,0 +1,379 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define _GNU_SOURCE +#include + +extern int errno; + +#define QUERY_BUFSIZ (8*1024) +#define DIR_UMASK 0755 +#define FILE_UMASK 0666 + +#define TRUE 1 +#define FALSE 0 +#define RE_OK 0 +#define RE_ERROR 1 + +typedef struct { + char *table, + *attr; + long lo_oid; +} lo_attr; + +void usage() +{ + printf("\nPostgreSQL large objects dump"); + printf("\npg_lo_dump