pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mason <freemason@gmail.com>
To: pgsql-patches@postgresql.org
Subject: Fwd: I would like to alter the COPY command
Date: Sat, 23 Dec 2006 19:08:56 -0800
Message-ID: <523e84030612231908i5c272b5atabe95643d482e157@mail.gmail.com> (raw)
In-Reply-To: <523e84030612231908s32ef5145s4e18582b4a579d07@mail.gmail.com>
References: <523e84030612231908s32ef5145s4e18582b4a579d07@mail.gmail.com>

What I have is data with two different characters for "start quote"
and "end quote".  In my case it's '[' and ']', but it could be
anything from "smart quotes", to parentheses, to brackets, braces, ^/$
in regexps, etc.  I think this isn't too unreasonable a feature to
have to make copy more functional when importing data that is
difficult to transform properly beforehand (in my case is about half a
terabyte of log files, which takes hours and hours, just to cat, let
alone reparse and dump into COPY).

Now, in my case I can just say "cat file | tr '[]' '""' | psql -f
import.sql", but then I lose the ability for psql to do anything smart
like using mmap (I'm making assumptions that it does anything smart
like that, but even if it doesn't now, it could some day).

So, I'm a passable c/c++ programmer, when I have to be, so
theoretically I can do the work myself, but I have never touched
postgres before, so I don't know where to begin.  Any ideas how to add
this?



view thread (3+ messages)  latest in thread

Message-ID: <523e84030612231908i5c272b5atabe95643d482e157@mail.gmail.com>
Permalink:  ../523e84030612231908i5c272b5atabe95643d482e157@mail.gmail.com/
Also on:    postgresql.org/message-id/523e84030612231908i5c272b5atabe95643d482e157@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: freemason@gmail.com, pgsql-patches@postgresql.org
  Subject: Re: Fwd: I would like to alter the COPY command
  In-Reply-To: <523e84030612231908i5c272b5atabe95643d482e157@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox