Thread: contrib/binarycopy

contrib/binarycopy

From
Lee Kindness
Date:
The attached tar archive and assosciated patch adds the binarycopy
module to contrib. I believe its functionality will be of interest to
many PostgreSQL users. From the readme:

This module contains routines to create a file suitable for reading by
the COPY BINARY command. It supports the creation of 2 file formats: if
POSTGRESQL_71 is defined when building then files compatible with
PostgreSQL 7.1 through to 7.3 will be created; if POSTGRESQL_74 is defined
then files compatible with PostgreSQL 7.4 and likely later versions will
be created.

The main purpose of this is to allow writing COPY BINARY files without
caring about the underlying format and any byte-swapping issues.

Currently most integer, float, text, varchar, bytea and timestamp
fields can be output. Support for other field types can be added on an
"as-needed" basis.

binarycopy.h includes documentation for each function, and these should
be fairly straight format to understand.

Regards, Lee Kindness.

Index: contrib/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql-server/contrib/Makefile,v
retrieving revision 1.45
diff -c -r1.45 Makefile
*** contrib/Makefile    24 Jul 2003 16:54:58 -0000    1.45
--- contrib/Makefile    5 Aug 2003 12:56:04 -0000
***************
*** 6,11 ****
--- 6,12 ----

  WANTED_DIRS = \
          array        \
+         binarycopy    \
          btree_gist    \
          chkpass        \
          cube        \

Attachment

Re: contrib/binarycopy

From
Bruce Momjian
Date:
This has been saved for the 7.5 release:

    http:/momjian.postgresql.org/cgi-bin/pgpatches2

---------------------------------------------------------------------------

Lee Kindness wrote:
Content-Description: message body text

> The attached tar archive and assosciated patch adds the binarycopy
> module to contrib. I believe its functionality will be of interest to
> many PostgreSQL users. From the readme:
>
> This module contains routines to create a file suitable for reading by
> the COPY BINARY command. It supports the creation of 2 file formats: if
> POSTGRESQL_71 is defined when building then files compatible with
> PostgreSQL 7.1 through to 7.3 will be created; if POSTGRESQL_74 is defined
> then files compatible with PostgreSQL 7.4 and likely later versions will
> be created.
>
> The main purpose of this is to allow writing COPY BINARY files without
> caring about the underlying format and any byte-swapping issues.
>
> Currently most integer, float, text, varchar, bytea and timestamp
> fields can be output. Support for other field types can be added on an
> "as-needed" basis.
>
> binarycopy.h includes documentation for each function, and these should
> be fairly straight format to understand.
>
> Regards, Lee Kindness.
>

[ Attachment, skipping... ]

> Index: contrib/Makefile
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/contrib/Makefile,v
> retrieving revision 1.45
> diff -c -r1.45 Makefile
> *** contrib/Makefile    24 Jul 2003 16:54:58 -0000    1.45
> --- contrib/Makefile    5 Aug 2003 12:56:04 -0000
> ***************
> *** 6,11 ****
> --- 6,12 ----
>
>   WANTED_DIRS = \
>           array        \
> +         binarycopy    \
>           btree_gist    \
>           chkpass        \
>           cube        \

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073