pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: achill@matrix.gatewaynet.com
To: David B <postgresql@thegatelys.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to figure out when was a table created
Date: Fri, 3 Oct 2003 09:33:35 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0310030923580.5168-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <GOEGKICPFOPNLIEIHGFJEEJOCBAA.postgresql@thegatelys.com>


Well, in certain filesystems you can have the birth time
(like ufs2) stored in the inode struct.

So you find the file name in your $PGDATA/base directory
using the oid of your table (in pg_class),
and then you open that file with stat (2) or utimes (2) (or
from perl) to read creation data.

All that apply for FreeBSD, see if creation time is supported
in ext2/3.

On Thu, 2 Oct 2003, David B wrote:

> Hi folks,
> 
> I posted this question a few days ago and got no response so I guess it
> cannot be done (surprising!)
> So that leaves me with my business problem.
> 
> We create a table for each days activity.
> After N days (typically 7 days) we can drop the table.
> The table name is not known so cannot force business to make tablename
> something like mydata_MMDDYY
> 
> I'd like to be able to do something like:
> 	SELECT tablename
> 	FROM   pg_???
> 	WHERE  to_char( ???, 'dd/mm/yy' ) = to_char( now() - interval '7 days',
> 'dd/mm/yy' )
> 
> Any suggestions?
> 
> --- Prior msg was:
> 
> Folks,
> 
> I have a list of tables for which I want to get the date they were
> created...and if possible the date last updateded.
> 
> I suspect there is a pg_??? table that can answer this question but I don't
> know what it is and I cannot find it mentioned in any docs.
> 
> Any suggestions...tia
> -D
> 
> p.s. Love this forum!
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 




view thread (5+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0310030923580.5168-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0310030923580.5168-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0310030923580.5168-100000@matrix.gatewaynet.com

 · 

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-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, postgresql@thegatelys.com
  Subject: Re: How to figure out when was a table created
  In-Reply-To: <Pine.LNX.4.44.0310030923580.5168-100000@matrix.gatewaynet.com>

* 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