pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedprivate table
3+ messages / 3 participants
[nested] [flat]
* private table
@ 2005-01-26 08:13 Din Adrian <adrian.din@easynet.ro>
0 siblings, 2 replies; 3+ messages in thread
From: Din Adrian @ 2005-01-26 08:13 UTC (permalink / raw)
To: pgsql-sql
Hello,
I am want to use a private table in postgresql(every client to see his own
data).
Is this possible? How can I do it!
Thank you,
Adrian Din
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [despammed] private table
@ 2005-01-26 08:33 Andreas Kretschmer <akretschmer@despammed.com>
parent: Din Adrian <adrian.din@easynet.ro>
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Kretschmer @ 2005-01-26 08:33 UTC (permalink / raw)
To: pgsql-sql
am 26.01.2005, um 10:13:52 +0200 mailte Din Adrian folgendes:
> Hello,
> I am want to use a private table in postgresql(every client to see his own
> data).
> Is this possible? How can I do it!
Why?
You can create different users and/or different databases.
Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47212, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
eMail schreiben kann jeder -- lernen: http://webserv/email/email.html
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: private table
@ 2005-01-26 08:55 Richard Huxton <dev@archonet.com>
parent: Din Adrian <adrian.din@easynet.ro>
1 sibling, 0 replies; 3+ messages in thread
From: Richard Huxton @ 2005-01-26 08:55 UTC (permalink / raw)
To: Din Adrian <adrian.din@easynet.ro>; +Cc: pgsql-sql
Din Adrian wrote:
> Hello,
> I am want to use a private table in postgresql(every client to see his
> own data).
> Is this possible? How can I do it!
If I understand what you want, then this is traditionally done using views.
CREATE TABLE base_table (
a integer NOT NULL,
b text,
u name,
PRIMARY KEY (a)
);
CREATE VIEW my_rows AS
SELECT a,b FROM base_table WHERE u = CURRENT_USER;
Add rules so that updating my_rows updates base_table instead. Then,
revoke access on base_table (apart from your super-user) but grant it on
my_rows.
As far as a user is concerned "my_rows" just contains their rows and if
they log in as a different user they will see different data.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-01-26 08:55 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-26 08:13 private table Din Adrian <adrian.din@easynet.ro>
2005-01-26 08:33 ` Andreas Kretschmer <akretschmer@despammed.com>
2005-01-26 08:55 ` Richard Huxton <dev@archonet.com>
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