X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 98089D1B4E5 for ; Fri, 3 Oct 2003 06:21:56 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 73056-04 for ; Fri, 3 Oct 2003 03:21:07 -0300 (ADT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 26A41D1B4F0 for ; Fri, 3 Oct 2003 03:21:05 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id h936XaBb008100; Fri, 3 Oct 2003 09:33:36 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id h936XZ0J008096; Fri, 3 Oct 2003 09:33:35 +0300 Date: Fri, 3 Oct 2003 09:33:35 +0300 (EEST) From: achill@matrix.gatewaynet.com To: David B Cc: pgsql-sql@postgresql.org Subject: Re: How to figure out when was a table created In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/40 X-Sequence-Number: 15440 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) >