Re: Patch for - Allow server logs to be remotely read

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Dhanaraj(dot)M(at)Sun(dot)COM, pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch for - Allow server logs to be remotely read
Date: 2006-06-08 14:15:14
Message-ID: 200606081415.k58EFEj20094@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > Bruce Momjian wrote:
> > >
> > > Uh, I just added /contrib/adminpack a few weeks ago to CVS, which does
> > > this, and more. Sorry I forgot to mark the TODO item as completed.
> >
> > Huh, how do you read files with adminpack? I only see
> >
> > Datum pg_file_write(PG_FUNCTION_ARGS);
> > Datum pg_file_rename(PG_FUNCTION_ARGS);
> > Datum pg_file_unlink(PG_FUNCTION_ARGS);
> > Datum pg_logdir_ls(PG_FUNCTION_ARGS);
>
> Uh, README.adminpack shows:
>
> int8 pg_catalog.pg_file_write(fname text, data text, append bool)
> int8 pg_catalog.pg_file_read(fname text, data text, append bool)
> bool pg_catalog.pg_file_rename(oldname text, newname text)
> bool pg_catalog.pg_file_rename(oldname text, newname text, archivname text)
> bool pg_catalog.pg_file_unlink(fname text)
> bigint pg_catalog.pg_file_size(text)
> int4 pg_catalog.pg_logfile_rotate()
> setof record pg_catalog.pg_logdir_ls()
>
> Is that wrong? Yes. Looking at the C file, I see what you mean. Let
> me update the README.adminpack file. read_file is already in the
> backend code, and was in 8.1.X too.
>
> test=> \df *read*
> List of functions
> Schema | Name | Result data type | Argument data types
> ------------+--------------+------------------+----------------------
> pg_catalog | loread | bytea | integer, integer
> pg_catalog | pg_read_file | text | text, bigint, bigint
> (2 rows)
>
> The unlink part is part of the adminpack.

I see it now. They do some renaming of functions to match the use by
pgadmin, etc:

CREATE FUNCTION pg_catalog.pg_file_read(text, bigint, bigint)
RETURNS text
AS 'pg_read_file'
LANGUAGE INTERNAL VOLATILE STRICT;

'pg_file_read' becomes 'pg_read_file.' Anyway, the read part was
already in the backend, and the unlink part is new in adminpack.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-06-08 14:17:07 Re: Patch for - Allow server logs to be remotely read
Previous Message Bruce Momjian 2006-06-08 14:10:14 Re: Patch for - Allow server logs to be remotely read