Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7857EB5DBC8 for ; Fri, 17 Jun 2011 08:13:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 21470-05 for ; Fri, 17 Jun 2011 11:13:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id 1CEF8B5D803 for ; Fri, 17 Jun 2011 08:13:15 -0300 (ADT) Received: by pzk9 with SMTP id 9so1666831pzk.19 for ; Fri, 17 Jun 2011 04:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Ub7K3Ic4canvzhoHNHh3uQY3CI1GGysvntDonKr9mOE=; b=VHi3APxYqsyubUqQUOUrZnrtJGnZ+WdRfpnqUEJZk71V9FkzknWxMuB1Qo1xYrkVGW sWmJ4NCTOgsWHAdBtOlORMD45SUJaT3v3Bp8buAuXCOTPtdMjntkGWXRPZ2+tCWAvKq+ m6y/g3t0MF5NTKpLFm7xYbtGGt/VToUGy4IEw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=uH5xwMsygR8vZF0k0ieBaNXPbEWaRWEzRXAzjYSMfoluvxpB0wGQDvv0m+QtsTb5X6 Fp8W+1u3ZGkUyaVITCTAzBWUI9SnkdKFLVXnL2S4Co8ByosXf1BYHjrT1Ogr+dyIT7xj 2swirxFY4SCaw9WniF2XluMQmiyUkmsmGJC/w= Received: by 10.142.131.2 with SMTP id e2mr331435wfd.143.1308309195627; Fri, 17 Jun 2011 04:13:15 -0700 (PDT) Received: from [192.168.1.120] ([61.199.203.168]) by mx.google.com with ESMTPS id o16sm2683130wff.13.2011.06.17.04.13.13 (version=SSLv3 cipher=OTHER); Fri, 17 Jun 2011 04:13:14 -0700 (PDT) Message-ID: <4DFB36D7.3070208@gmail.com> Date: Fri, 17 Jun 2011 20:13:27 +0900 From: Shigeru Hanada User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ja; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Joshua Berkus CC: pgsql-docs@postgresql.org Subject: Re: File_FDW with example References: <1054372046.268838.1308273696804.JavaMail.root@mail-1.01.com> In-Reply-To: <1054372046.268838.1308273696804.JavaMail.root@mail-1.01.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201106/78 X-Sequence-Number: 6852 (2011/06/17 10:21), Joshua Berkus wrote: > (apologies for prior incomplete post. Webmail spazzed on me). > > Attached is a version of file_FDW.sgml which contains a complete example of how to use it to read your postgresql csv logs. I think this does some neat tying together of how to use FDWs that the docs are currently lacking. Such example would be useful for administrators who wants to manage servers via SQL. :-) I examined the example, and found some points which should be corrected: - Some lines are over 80 columns. - CREATE EXTENSION file_fdw also creates default FOREIGN DATA WRAPPER file_fdw, so no need to create FOREIGN DATA WRAPPER explicitly. BTW, filename option can be changed via SQL: ALTER FOREIGN TABLE pglog OPTIONS ( SET filename '/path/to/new/file' ); I think it's worth to mention the way to switch to new log file after log rotation. Regards, -- Shigeru Hanada