Re: pgsql 8.1 instrumentation status - Mailing list pgadmin-hackers

From Dave Page
Subject Re: pgsql 8.1 instrumentation status
Date
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9CEC@ratbert.vale-housing.co.uk
Whole thread Raw
In response to pgsql 8.1 instrumentation status  (Andreas Pflug <pgadmin@pse-consulting.de>)
Responses Re: pgsql 8.1 instrumentation status  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgadmin-hackers

> -----Original Message-----
> From: Andreas Pflug [mailto:pgadmin@pse-consulting.de]
> Sent: 28 August 2005 23:02
> To: Dave Page
> Cc: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] pgsql 8.1 instrumentation status
>
> >
> > No, just hit that. We knew absolute paths outside the data dir were
> > going to be rejected, but they seem to have gone further.
> They should be
> > allow if:
> >
> > 1) The path starts with $PGDATA
> > 2) The path exactly matches one of the config files.
>
> logfiles may go somewhere else too.

Yup.

> > I would call this a bug. If you've got time to produce a
> simple patch,
> > I'll try to argue it in.
>
> I won't. A perfectly working and tightly restricted version
> is available
> for more than a year now.

Yes, but that wasn't accepted into core exactly as written, and seems to
have got modified incorrectly at some point (there was no discussion of
removing the functionality we're missing - I think it's an oversight),
and will not be going into pgInstaller unless there is absolutely no
usable alternative. The attached patch should give us the same
capabilities as we had before. Does it look OK to you before I post it?
(note that it doesn't try to match the config file names, just dup the
code we had before).

> pg_logdir_ls...
> I won't duplicate pgsql's formatting/interpreting code in pgadmin.

Eh? I still think what you're trying to there is overkill, and limits
flexibility by forcing the user to use a specific filename format. I
think we should just look at the log_filename, and use all characters up
until the first % and from the last % (+1 char) as a pattern match in
the log directory. Eg,

postgresql-%Y-%m-%d_%H%M%S.log gives us a search pattern of
postgresql-*.log

If anyone is a) mixing logs in one directory and b) using ambiguous
names for different app logs in that directory, then they deserve any
bizarre effects they might see *if* they try to view the wrong log. For
everyone else, name format changes are now possible to suit their needs.

Regards, Dave.



Attachment

pgadmin-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: pgsql 8.1 instrumentation status
Next
From: Andreas Pflug
Date:
Subject: Re: pgsql 8.1 instrumentation status