Re: Systems view which gives creation date for a table?

Lists: pgsql-novice
From: Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: Systems view which gives creation date for a table?
Date: 2008-11-17 16:53:25
Message-ID: 4921A185.1040206@demog.berkeley.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi all,

I would like to be able to query some systems table or view to
obtain the creation data of a table. INFORMATION_SCHEMA does not seem
to record this information. Does postgres store it somewhere?

I need this for a PHP/postgres application which creates temporary
tables which should be cleaned up when my application finishes. But
sometimes they aren't., so I have to write code to find these tables and
drop them. There is a better solution -- to use CREATE TEMPORARY
TABLE. But to do this I would have to use PHP persistent data base
connections which, unlike the ordinary connections which my application
currently uses, drop and recreate connections when I move from one page
to another.
Changing means a significant code rewrite. I could, of course, encode
the creation date into the name of the table.

But I would like to know how to find the creation date of a table.

Thanks in advance

Mary Anderson


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Systems view which gives creation date for a table?
Date: 2008-11-17 17:15:09
Message-ID: 4529.1226942109@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu> writes:
> I would like to be able to query some systems table or view to
> obtain the creation data of a table. INFORMATION_SCHEMA does not seem
> to record this information. Does postgres store it somewhere?

No.

regards, tom lane


From: "Michael Swierczek" <mike(dot)swierczek(at)gmail(dot)com>
To: "Mary Anderson" <maryfran(at)demog(dot)berkeley(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Systems view which gives creation date for a table?
Date: 2008-11-17 18:11:19
Message-ID: 68b5b5880811171011w749f2d36w55c0022bf827e393@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Would it make sense to have a permanent table with the names of
temporary tables and their creation dates?

On Mon, Nov 17, 2008 at 11:53 AM, Mary Anderson
<maryfran(at)demog(dot)berkeley(dot)edu> wrote:
> Hi all,
>
> I would like to be able to query some systems table or view to obtain the
> creation data of a table. INFORMATION_SCHEMA does not seem to record this
> information. Does postgres store it somewhere?
>
> I need this for a PHP/postgres application which creates temporary tables
> which should be cleaned up when my application finishes. But sometimes they
> aren't., so I have to write code to find these tables and drop them. There
> is a better solution -- to use CREATE TEMPORARY TABLE. But to do this I
> would have to use PHP persistent data base connections which, unlike the
> ordinary connections which my application currently uses, drop and recreate
> connections when I move from one page to another. Changing means a
> significant code rewrite. I could, of course, encode the creation date into
> the name of the table.
>
> But I would like to know how to find the creation date of a table.
>
> Thanks in advance
>
> Mary Anderson
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>