Re: Object create date

From: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
To: "'George Pavlov'" <gpavlov(at)mynewplace(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Object create date
Date: 2008-12-29 21:20:26
Message-ID: 9FF593BDFF9A49EA9FA6A1884DD52F2B@iptel.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks Pavlov for your response.

> -----Mensaje original-----
> De: George Pavlov [mailto:gpavlov(at)mynewplace(dot)com]
> <fhevia(at)ip-tel(dot)com(dot)ar> wrote:
> > Hi list,
> >
> > I'm having a hard time trying to find out if the latest
> patches have
> > been applied to my application (uses lots of pgplsql functions).
> > Does Postgres store creation date and/or modification date
> for tables,
> > functions and other objects?
> > It would help me a lot if I could query each object when it was
> > created. Is this information available on 8.3? Where should I look?
>
> 1. not exactly what you were looking for, but i answer this
> partially by putting a commented-out CVS expansion tag (e.g.
> $Id:) in the body of the function so that it gets into the
> catalog and can be searched:
>
> CREATE OR REPLACE FUNCTION foo ()
> RETURNS void AS
> $BODY$
> -- $Id: foo.sql,v 1.6 2008/12/23 00:06:52 gpavlov Exp $
> BEGIN
> ...
>

I am already doing this. Sadly I've found it to be very fragile in face of a careless programmer who forgets to update the tags. Myself being the prime suspect. :)

> and query it by something like this:
>
> select
> routine_name,
> substring(routine_definition from E'%#\042-- #\044Id: %
> Exp #\044#\042%' for '#') as cvs_id
> from information_schema.routines
> ;

This query is very helpful.

>
> 2. you can also make some inference about the relative timing
> of object creation based on the OIDs (query
> pg_catalog.pg_proc rather than information_schema.routines
> for proc OIDs).
>

I am not sure this would be helpful since different databases are involved (same product on several installations).
I think that with the above query I will be able to sort things out.
Thank you.

Regards,
Fernando.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2008-12-29 21:39:16 Re: Object create date
Previous Message Fernando Hevia 2008-12-29 21:20:21 Re: Object create date