pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: pgsql-general@postgresql.org
Subject: Re: How could I find the last modified procedure in the database?
Date: Wed, 16 Nov 2011 19:02:11 -0500
Message-ID: <24408.1321488131@sss.pgh.pa.us> (raw)
In-Reply-To: <20111116163055.GA13297@tux>
References: <CAJfXtLcpC89EY-wMecQs_uMprtgUxyh7VomJgGNXQQQgW4N1cw@mail.gmail.com>
	<20111116163055.GA13297@tux>

Andreas Kretschmer <akretschmer@spamfence.net> writes:
> Dhimant Patel <drp4kri@gmail.com> wrote:
>> I also created several procedures/functions and now I don't remember the last
>> procedure I worked on! - I thought I could always get this from metadata.
>> Now I'm stuck - couldn't find this details anywhere in catalog tables!
>> Is there anyway I can get this information?

> Maybe with this query:
> select proname from pg_proc order by oid desc limit 1;
> but i'm not really sure ... tias (try it and see)

The OIDs would tell you the creation order, but they don't change during
CREATE OR REPLACE FUNCTION; so depending on what the OP means by "worked
on", this query might not be very useful to him.

I'd try looking to see which row in pg_proc has the latest xmin.
Unfortunately you can't "ORDER BY xmin" ...

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <24408.1321488131@sss.pgh.pa.us>
Permalink:  ../24408.1321488131@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24408.1321488131@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, akretschmer@spamfence.net, pgsql-general@postgresql.org
  Subject: Re: How could I find the last modified procedure in the database?
  In-Reply-To: <24408.1321488131@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox