X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 24A549DC9A5 for ; Sun, 19 Mar 2006 19:28:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05557-09 for ; Sun, 19 Mar 2006 19:28:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailrouter.internal.box (unknown [203.48.241.83]) by postgresql.org (Postfix) with ESMTP id E95759DC83A for ; Sun, 19 Mar 2006 19:28:30 -0400 (AST) Received: from localhost (localhost [IPv6:::1]) by mailrouter.internal.box (Postfix) with ESMTP id 30CF0221243 for ; Mon, 20 Mar 2006 10:37:09 +1100 (EST) From: "Bath, David" Reply-To: dave.bath@unix.net To: pgsql-sql@postgresql.org Subject: Lead and tail quotes with \pset fieldsep Date: Mon, 20 Mar 2006 10:37:07 +1100 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603201037.07638.dave.bath@unix.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200603/277 X-Sequence-Number: 24623 Folks If I want psql to generate CSV files fully-double-quoted I can use pset as follows psql> \pset fieldsep "," However this does not put a quote before the first field and after the last, so each row comes out as 1234","blahblah","sdfgsg","foo","bar Is there a way to use psql to give rows like 1234","blahblah","sdfgsg","foo","bar or is there another tool I should use. COPY doesn't deal with views and restrictions well so it is not an option. Thanks in advance -- David T. Bath dave.bath@unix.net