Skip site navigation (1) Skip section navigation (2)

Re: File_FDW with example

From: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
To: Joshua Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: File_FDW with example
Date: 2011-06-17 11:13:27
Message-ID: 4DFB36D7.3070208@gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
(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

In response to

Responses

pgsql-docs by date

Next:From: Shigeru HanadaDate: 2011-06-17 11:24:25
Subject: Re: File_FDW with example
Previous:From: Robert HaasDate: 2011-06-17 04:55:25
Subject: Re: psql's ON_ERROR_STOP is misdocumented

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group