Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E43789F93A2 for ; Sat, 23 Dec 2006 23:08:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 58187-07 for ; Sat, 23 Dec 2006 23:08:20 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 470A19F939F for ; Sat, 23 Dec 2006 23:08:26 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so70884ugf for ; Sat, 23 Dec 2006 19:08:24 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=CnK6hALvWf5nIQjtyxe85LjY11HdMhy3rzhtLIfNYUQ/SuJQ1UQQ3KAaPkhqz7rR6IwgGCJPt1KIpgIkM79Jyc/eeCr7Gqvpidghtnm7K5Xf5AqdY/RCGSspFzQc+7xj1Oe6fBEnje1IAbZwf3UBSfRTllwTLM7dz9XlXKUZ6So= Received: by 10.78.185.15 with SMTP id i15mr2061812huf.1166929704593; Sat, 23 Dec 2006 19:08:24 -0800 (PST) Received: by 10.78.171.4 with HTTP; Sat, 23 Dec 2006 19:08:24 -0800 (PST) Message-ID: <523e84030612231908s32ef5145s4e18582b4a579d07@mail.gmail.com> Date: Sat, 23 Dec 2006 19:08:24 -0800 From: Mason To: pgsql-sql@postgresql.org Subject: I would like to alter the COPY command MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/189 X-Sequence-Number: 27145 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?