Re: How could we make it simple to access the log as a table?

From: Jim Nasby <jim(at)nasby(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Christopher Browne <cbbrowne(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Stephen Frost <sfrost(at)snowman(dot)net>, Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How could we make it simple to access the log as a table?
Date: 2012-06-06 22:24:08
Message-ID: 4FCFD888.6020908@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/28/12 2:55 PM, Robert Haas wrote:
> As far as CSV goes, I think the biggest deficiency is that there's a
> mismatch between the way that log files are typically named (e.g. one
> per day, or one per hour) and the way that a CSV foreign table is
> created (you've got to point it at one particular file). Maybe we
> could have a CSV reader that understands PostgreSQL-format CSV logs,
> but you point it at a directory, rather than a single file, and it
> reads all the CSV files in the directory. And maybe it could also be
> smart enough that if you've got a WHERE clause that filter by date, it
> uses that to skip any files that can be proven irrelevant. So the
> user can just turn on CSV logging, point the FDW at the log directory,
> and away they go.

The idea is a really good one, except for one thing: this pattern is undoubtedly not unique to PG CSV logs.

ISTM it would be extremely useful to have a generic ability to define a filename pattern and have all files matching that pattern be pulled in via FDW; possibly be treating each file as a partition, possibly complete with exclusion constraints.

ISTM that what's really needed here are a bunch of separate improvements to our logging and/or FDW, each of which will add usefulness.
--
Jim C. Nasby, Database Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2012-06-06 22:25:04 Re: pg_receivexlog and feedback message
Previous Message Daniel Farina 2012-06-06 22:04:48 Re: Inconsistency in libpq connection parameters, and extension thereof