Re: can I get a bit more attribute out of \dt directive?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: can I get a bit more attribute out of \dt directive?
Date: 2009-10-20 20:44:50
Message-ID: dcc563d10910201344t6ec78e82hb67aaac471279d89@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Oct 20, 2009 at 2:42 PM, Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu> wrote:
> Hi Scott,
>
> Thank you for your reply.
>
>> That information is not stored by the db really,
>> so there's no way to get it.
>
> I think then I would build another column for
> timestamp.  But in object-oriented lingo, this
> would be a class field, rather than instance
> field, and I don't want to timestamp every row
> of each table.  The timestamp is strictly to
> tell when it was last modified.
>
> Is there any good way to do this?

Do you mean when the table was modified (i.e. alter table add column)
or when the data in the table was changed? If it's when the table was
changed, the easiest way is to store that in the comment for the table
whenever you alter it. Otherwise, you'll want a trigger or something
to store the latest update time in the latest row updated. There's
probably other ways too, but would involve a separate table to store
such things.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tena Sakai 2009-10-20 21:14:05 Re: can I get a bit more attribute out of \dt directive?
Previous Message Tena Sakai 2009-10-20 20:42:16 Re: can I get a bit more attribute out of \dt directive?