pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Current User
3+ messages / 3 participants
[nested] [flat]

* Current User
@ 1998-11-11 23:30 Jorge Maturana <ateo@labsd.inf.utfsm.cl>
  1998-11-12 21:52 ` Re: [SQL] Current User David Hartwig <daveh@insightdist.com>
  1998-11-13 00:12 ` Re: [SQL] Current User D'Arcy J.M. Cain <darcy@druid.net>
  0 siblings, 2 replies; 3+ messages in thread

From: Jorge Maturana @ 1998-11-11 23:30 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I want to have a table to manage  a register of the modifications made to
several tables by a group of users, that table should contain the name of the
postgres user that made the modificaction, now, How can I get the name (or
the user id) of the current user logged in?,there are some "pg_currentuser"
table to make a select?

I would thank any help.

-- 
Jorge Maturana Ortiz
Laboratorio de Sistemas Distribuidos - Departamento de Informatica
Universidad Tecnica Federico Santa Maria, Valparaiso - Chile
mailto:ateo@labsd.inf.utfsm.cl



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] Current User
  1998-11-11 23:30 Current User Jorge Maturana <ateo@labsd.inf.utfsm.cl>
@ 1998-11-12 21:52 ` David Hartwig <daveh@insightdist.com>
  1 sibling, 0 replies; 3+ messages in thread

From: David Hartwig @ 1998-11-12 21:52 UTC (permalink / raw)
  To: Jorge Maturana <ateo@labsd.inf.utfsm.cl>; +Cc: pgsql-sql

select CURRENT_USER;
 -- or --
select usesysid from pg_user where usename = CURRENT_USER;

Jorge Maturana wrote:

> Hi,
>
> I want to have a table to manage  a register of the modifications made to
> several tables by a group of users, that table should contain the name of the
> postgres user that made the modificaction, now, How can I get the name (or
> the user id) of the current user logged in?,there are some "pg_currentuser"
> table to make a select?
>
> I would thank any help.
>
> --
> Jorge Maturana Ortiz
> Laboratorio de Sistemas Distribuidos - Departamento de Informatica
> Universidad Tecnica Federico Santa Maria, Valparaiso - Chile
> mailto:ateo@labsd.inf.utfsm.cl




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] Current User
  1998-11-11 23:30 Current User Jorge Maturana <ateo@labsd.inf.utfsm.cl>
@ 1998-11-13 00:12 ` D'Arcy J.M. Cain <darcy@druid.net>
  1 sibling, 0 replies; 3+ messages in thread

From: darcy@druid.net @ 1998-11-13 00:12 UTC (permalink / raw)
  To: ateo@labsd.inf.utfsm.cl; +Cc: pgsql-sql

Thus spake Jorge Maturana
> I want to have a table to manage  a register of the modifications made to
> several tables by a group of users, that table should contain the name of the
> postgres user that made the modificaction, now, How can I get the name (or
> the user id) of the current user logged in?,there are some "pg_currentuser"
> table to make a select?

Look at insert_username in contrib/spi.  Basically you create a trigger
on insert.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1998-11-13 00:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-11-11 23:30 Current User Jorge Maturana <ateo@labsd.inf.utfsm.cl>
1998-11-12 21:52 ` David Hartwig <daveh@insightdist.com>
1998-11-13 00:12 ` D'Arcy J.M. Cain <darcy@druid.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox