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

Re: Object create date

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>,<pgsql-sql(at)postgresql(dot)org>
Subject: Re: Object create date
Date: 2008-12-29 20:30:48
Message-ID: 8C5B026B51B6854CBE88121DBF097A86033B3282@ehost010-33.exch010.intermedia.net (view raw or flat)
Thread:
Lists: pgsql-sql
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
  ...

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
  ;

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).



> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-
> owner(at)postgresql(dot)org] On Behalf Of Fernando Hevia
> Sent: Monday, December 29, 2008 10:23 AM
> To: pgsql-sql(at)postgresql(dot)org
> Subject: [SQL] Object create date
> 
> 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?
> 
> Thanks,
> Fernando
> 

In response to

Responses

pgsql-sql by date

Next:From: Fernando HeviaDate: 2008-12-29 21:20:21
Subject: Re: Object create date
Previous:From: Tom LaneDate: 2008-12-29 18:44:24
Subject: Re: where-used function

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