pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How could I find the last modified procedure in the database?
6+ messages / 6 participants
[nested] [flat]

* How could I find the last modified procedure in the database?
@ 2011-11-16 16:00 Dhimant Patel <drp4kri@gmail.com>
  2011-11-16 16:10 ` Re: How could I find the last modified procedure in the database? John R Pierce <pierce@hogranch.com>
  2011-11-16 16:30 ` Re: How could I find the last modified procedure in the database? Andreas Kretschmer <akretschmer@spamfence.net>
  2011-12-10 09:00 ` Re: How could I find the last modified procedure in the database? Jasen Betts <jasen@xnet.co.nz>
  0 siblings, 3 replies; 6+ messages in thread

From: Dhimant Patel @ 2011-11-16 16:00 UTC (permalink / raw)
  To: pgsql-admin; pgsql-general@postgresql.org

I have postgres *(PostgreSQL) 9.0.3 running.*
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?


Thanks,
DP.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How could I find the last modified procedure in the database?
  2011-11-16 16:00 How could I find the last modified procedure in the database? Dhimant Patel <drp4kri@gmail.com>
@ 2011-11-16 16:10 ` John R Pierce <pierce@hogranch.com>
  2 siblings, 0 replies; 6+ messages in thread

From: John R Pierce @ 2011-11-16 16:10 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

On 11/16/11 8:00 AM, Dhimant Patel wrote:
> I have postgres *(PostgreSQL) 9.0.3 running.*
> 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?

as far as I know, nothing like that is stored, unless you log DDL 
operations, and timestamp your logs, in which case it would be in the 
logfiles.



-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How could I find the last modified procedure in the database?
  2011-11-16 16:00 How could I find the last modified procedure in the database? Dhimant Patel <drp4kri@gmail.com>
@ 2011-11-16 16:30 ` Andreas Kretschmer <akretschmer@spamfence.net>
  2011-11-17 00:02   ` Re: How could I find the last modified procedure in the database? Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 1 reply; 6+ messages in thread

From: Andreas Kretschmer @ 2011-11-16 16:30 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

Dhimant Patel <drp4kri@gmail.com> wrote:

> I have postgres (PostgreSQL) 9.0.3 running.
> 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)


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How could I find the last modified procedure in the database?
  2011-11-16 16:00 How could I find the last modified procedure in the database? Dhimant Patel <drp4kri@gmail.com>
  2011-11-16 16:30 ` Re: How could I find the last modified procedure in the database? Andreas Kretschmer <akretschmer@spamfence.net>
@ 2011-11-17 00:02   ` Tom Lane <tgl@sss.pgh.pa.us>
  2011-11-17 12:15     ` Re: How could I find the last modified procedure in the database? hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2011-11-17 00:02 UTC (permalink / raw)
  To: Andreas Kretschmer <akretschmer@spamfence.net>; +Cc: pgsql-general@postgresql.org

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How could I find the last modified procedure in the database?
  2011-11-16 16:00 How could I find the last modified procedure in the database? Dhimant Patel <drp4kri@gmail.com>
  2011-11-16 16:30 ` Re: How could I find the last modified procedure in the database? Andreas Kretschmer <akretschmer@spamfence.net>
  2011-11-17 00:02   ` Re: How could I find the last modified procedure in the database? Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-11-17 12:15     ` hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 0 replies; 6+ messages in thread

From: hubert depesz lubaczewski @ 2011-11-17 12:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andreas Kretschmer <akretschmer@spamfence.net>; pgsql-general@postgresql.org

On Wed, Nov 16, 2011 at 07:02:11PM -0500, Tom Lane wrote:
> I'd try looking to see which row in pg_proc has the latest xmin.
> Unfortunately you can't "ORDER BY xmin" ...

order by age(xmin) ?

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How could I find the last modified procedure in the database?
  2011-11-16 16:00 How could I find the last modified procedure in the database? Dhimant Patel <drp4kri@gmail.com>
@ 2011-12-10 09:00 ` Jasen Betts <jasen@xnet.co.nz>
  2 siblings, 0 replies; 6+ messages in thread

From: Jasen Betts @ 2011-12-10 09:00 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; +Cc: pgsql-admin

On 2011-11-16, Dhimant Patel <drp4kri@gmail.com> wrote:

> I have postgres *(PostgreSQL) 9.0.3 running.*
> 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?

if you generated any exceptions during your work on the functions you
may find evidence in the database log.

-- 
⚂⚃ 100% natural




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2011-12-10 09:00 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-11-16 16:00 How could I find the last modified procedure in the database? Dhimant Patel <drp4kri@gmail.com>
2011-11-16 16:10 ` John R Pierce <pierce@hogranch.com>
2011-11-16 16:30 ` Andreas Kretschmer <akretschmer@spamfence.net>
2011-11-17 00:02   ` Tom Lane <tgl@sss.pgh.pa.us>
2011-11-17 12:15     ` hubert depesz lubaczewski <depesz@depesz.com>
2011-12-10 09:00 ` Jasen Betts <jasen@xnet.co.nz>

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