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

Re: Object create date

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Object create date
Date: 2008-12-29 18:37:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Mon, Dec 29, 2008 at 11:23 AM, Fernando Hevia <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?

PostreSQL doesn't track this kind of thing for you.  An easy method to
implement yourself is to create a table to track such changes, and add
a line to insert data into that table.

create table change_track (version numeric(12,2) primary key, title
text, summary text);

Then in a script, always update like so:

insert into change_track(10.2, 'plpgsql - add / remove','New plpgsql
stored procedure to add and remove users.  adduser(uid,''username''),

create function....


That way, if some part of the update fails it all fails and you don't
have any of it in your db.

Then you can just check change_track to see what stuff is in your db.
Plus you can check the scripts into svn for management.

In response to


pgsql-sql by date

Next:From: Alvaro HerreraDate: 2008-12-29 18:38:10
Subject: Re: Object create date
Previous:From: Fernando HeviaDate: 2008-12-29 18:23:15
Subject: Object create date

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