Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXFZf-0007EV-9F for pgsql-admin@arkaria.postgresql.org; Mon, 07 Apr 2014 19:51:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXFZe-0005wI-GJ for pgsql-admin@arkaria.postgresql.org; Mon, 07 Apr 2014 19:51:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXFZd-0005vx-A6 for pgsql-admin@postgresql.org; Mon, 07 Apr 2014 19:51:17 +0000 Received: from mail-ie0-f172.google.com ([209.85.223.172]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXFZZ-0005iK-Ab for pgsql-admin@postgresql.org; Mon, 07 Apr 2014 19:51:16 +0000 Received: by mail-ie0-f172.google.com with SMTP id as1so6830030iec.3 for ; Mon, 07 Apr 2014 12:51:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version:content-type; bh=V5XIaeMN//PQgU8R3KO68CWpVrVlgh1HFg7h19a1nyw=; b=WpzsAhRxtNjofNrGwYtQsrwFJ6VtMvKDZop3BcCpmzslcOq0QbFldYTKNwNFJWUuOm AvW7/im1xNPGk54cwfKqphOc1K12K65dUshdZ/Pzdu8MOgvZiZrFASoBQWMzBedF2wzR Civ0cTaoJArPqK54/bGIna19BcTf0VHoxQ+LpE7Z7wdtvXnwpdFi7ijDIyC51JRYxmz1 eWk2INzAfMKRAr9lFGe6x2a49Z3B01tyXB/u9EI7iuFQ6D3O1Jye8EIBJL6Ulb51NBKB SzHazAYV0KB/K/bxFKz7k1TczusXXdQGszO9paK24EYnWXWtG/uMQRigxkxO4Xu4cXCg 1j+g== X-Gm-Message-State: ALoCoQl1SgZ9tNFQ1NLNwAhtdTP/DC1bVFPOEumv4R29FRKl86fwTlY0JgFvaGlwKnYT5MowLbmyqcS2yjtfaTvyoOS6w9s6921ephcuGu4krzfeP9UivhU= X-Received: by 10.43.141.81 with SMTP id jd17mr26872704icc.39.1396900271167; Mon, 07 Apr 2014 12:51:11 -0700 (PDT) Received: from palos ([50.76.140.65]) by mx.google.com with ESMTPSA id vc5sm22062788igb.3.2014.04.07.12.51.09 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Apr 2014 12:51:10 -0700 (PDT) Date: Mon, 7 Apr 2014 13:51:27 -0600 From: Jason Mathis To: "=?utf-8?Q?pgsql-admin=40postgresql.org?=" , Steve Crawford , Nik Tek Message-ID: In-Reply-To: <5342DA72.2030103@pinpointresearch.com> References: <5342DA72.2030103@pinpointresearch.com> Subject: Re: How to find table creation time X-Mailer: Airmail (237) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="534301bf_3d1b58ba_2ad6" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --534301bf_3d1b58ba_2ad6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sorry Guys i responded earlier but only to Guillaume for some unexplained r= eason:/ Anyways steve suggested what I was going to suggest. I think its a = great advice going forward.=C2=A0 That is crazy that creation time is not logged anywhere.=C2=A0 One thing to note, you can log ddl changes in postgres. Some would argue th= is should be on by default and i would agree.=C2=A0 In the postgres.conf>> log_statement =3D ddl Moving forward that will give you the creation time of tables. Although I k= now your objective may have been to go back in time:) =C2=A0Anyways I actua= lly parse the logs out and have an email sent to me if a DDL statement happ= ens. Its a nice way to keep a pulse on schema changes or to catch someone = =E2=80=9Csneaking in=E2=80=9D a change. Or even think about data recovery, = =E2=80=9Cwhat time did you drop that production table?=E2=80=9D is no longe= r a question.=C2=A0 hopefully that can help! -jason=C2=A0 That is crazy that creation time is not logged anywhere.=C2=A0 One thing to note, you can log ddl changes in postgres. Some would argue th= is should be on by default and i would agree.=C2=A0 In the postgres.conf>> log_statement =3D ddl Moving forward that will give you the creation time of tables. Although I k= now your objective may have been to go back in time:) =C2=A0Anyways I actua= lly parse the logs out and have an email sent to me if a DDL statement happ= ens. Its a nice way to keep a pulse on schema changes or to catch someone = =E2=80=9Csneaking in=E2=80=9D a change. Or even think about data recovery, = =E2=80=9Cwhat time did you drop that production table?=E2=80=9D is no longe= r a question.=C2=A0 hopefully that can help! -jason=C2=A0 On April 7, 2014 at 11:04:21 AM, Steve Crawford (scrawford@pinpointresearch= .com) wrote: On 04/04/2014 04:39 PM, Nik Tek wrote: =20 > Hi, =20 > =20 > Is there a way to find table creation time in postgres? =20 > pg version is 9.0 =20 > =20 Not by some baked-in command but you can determine it from the logs if =20 you have the appropriate log-settings and sufficient log-retention. =20 Cheers, =20 Steve =20 -- =20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) =20 To make changes to your subscription: =20 http://www.postgresql.org/mailpref/pgsql-admin =20 --=20 =20 This transmission contains confidential and privileged information intended= =20 solely for the party identified above. If you receive this message in=20 error, you must not use it or convey it to others. Please destroy it=20 immediately and contact the sender at (303) 386-3955 or by return e-mail to= =20 the sender. --534301bf_3d1b58ba_2ad6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =
Sorry Guys i responded earlier but only to Guillau= me for some unexplained reason:/ Anyways steve suggested what I was going t= o suggest. I think its a great advice going forward. 


That is crazy that creation time is not logg= ed anywhere. 

<= i>One thing to note, you can log ddl changes in postgres. Some would argue = this should be on by default and i would agree. 

In the postgres.conf>>
=

log_statement =3D ddl<= /div>

<= div id=3D"bloop_customfont" style=3D"margin: 0px;">Moving forward that w= ill give you the creation time of tables. Although I know your objective ma= y have been to go back in time:)  Anyways I actually parse the logs ou= t and have an email sent to me if a DDL statement happens. Its a nice way t= o keep a pulse on schema changes or to catch someone =E2=80=9Csneaking in= =E2=80=9D a change. Or even think about data recovery, =E2=80=9Cwhat time d= id you drop that production table?=E2=80=9D is no longer a question. <= /i>

hopefully that ca= n help!
-jason&nb= sp;

=


That is crazy that creation = time is not logged anywhere. 

One thing to note, you can log ddl changes in postgres. Some would arg= ue this should be on by default and i would agree. 

In the postgres.conf>>

log_statement =3D ddl

Moving forward that will give you the creation time of table= s. Although I know your objective may have been to go back in time:)  = Anyways I actually parse the logs out and have an email sent to me if a DDL= statement happens. Its a nice way to keep a pulse on schema changes or to = catch someone =E2=80=9Csneaking in=E2=80=9D a change. Or even think about d= ata recovery, =E2=80=9Cwhat time did you drop that production table?=E2=80= =9D is no longer a question. 

hopefully that can help!

-= jason 






On April 7, 2014 = at 11:04:21 AM, Steve Crawford (scrawford@pinpointresearch.com) wrote:

On 04/04/2014 04:39 PM, = Nik Tek wrote:
> Hi,
>
> Is there a way to find table creation time in postgres?
> pg version is 9.0
>
Not by some baked-in command but you can determine it from the logs if = =20
you have the appropriate log-settings and sufficient log-retention.

Cheers,
Steve



-- =20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

This transmission contains confidential = and privileged information intended solely for the party identified above. If you receive = this message in error, you must not use it or convey it to others. Please destroy it immediately and contact the se= nder at (303) 386-3955 or by return e-mail to the sender.

--534301bf_3d1b58ba_2ad6--