Suggested way of associating PG user metadata with record

From: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Suggested way of associating PG user metadata with record
Date: 2009-05-20 10:28:49
Message-ID: db471ace0905200328r483774d3s90d511822595137@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I'd like to associate the PG user who created certain sorts of records
with that record in my application. The obvious way to do this is by
creating a text column with a default value of current_user in the
record's table, or perhaps something similar with a trigger. However,
because what I've described strikes me as a fairly common requirement,
I suspect there may be a purpose-built, more direct and efficient
feature I could use, such as a referential user datatype or something
like that.

Is there? If not, does the obvious approach seem reasonable?

Regards,
Peter Geoghegan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David 2009-05-20 10:35:08 Fwd: Getting ID of last-inserted row
Previous Message Raymond O'Donnell 2009-05-20 10:23:38 Re: Getting ID of last-inserted row