Long term read-only records?

Started by Jason Hihnabout 23 years ago6 messagesgeneral
Jump to latest
#1Jason Hihn
jhihn@paytimepayroll.com

Is there a way to make a record read-only for months or years? My intent is
that after a cutoff (a program can run making rows r/o) existing records can
no longer be modified without unlocking first. User security is
insufficient, since that only applies to tables. I'd rather not have to
maintain a R/O flag (or date) in code, because it relies on correct,
voluntary implementation every time. I'd like something more enforceable
then that, and that has me looking to the DBMS

Thank you for your time.

#2Dennis Gearon
gearond@cvc.net
In reply to: Jason Hihn (#1)
Re: Long term read-only records?

You can also set users to not do things like triggers, views, functions, etc,
and basically leave nothing but SELECT. That won't work?

Jason Hihn wrote:

Show quoted text

Is there a way to make a record read-only for months or years? My intent is
that after a cutoff (a program can run making rows r/o) existing records can
no longer be modified without unlocking first. User security is
insufficient, since that only applies to tables. I'd rather not have to
maintain a R/O flag (or date) in code, because it relies on correct,
voluntary implementation every time. I'd like something more enforceable
then that, and that has me looking to the DBMS

Thank you for your time.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#3Dennis Gearon
gearond@cvc.net
In reply to: Dennis Gearon (#2)
Re: Long term read-only records?

OOOPS,
record by record, I see. Mabye the flag in combination with a view?

Dennis Gearon wrote:

Show quoted text

You can also set users to not do things like triggers, views, functions,
etc, and basically leave nothing but SELECT. That won't work?

Jason Hihn wrote:

Is there a way to make a record read-only for months or years? My
intent is
that after a cutoff (a program can run making rows r/o) existing
records can
no longer be modified without unlocking first. User security is
insufficient, since that only applies to tables. I'd rather not have to
maintain a R/O flag (or date) in code, because it relies on correct,
voluntary implementation every time. I'd like something more enforceable
then that, and that has me looking to the DBMS

Thank you for your time.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#4Richard Huxton
dev@archonet.com
In reply to: Dennis Gearon (#3)
Re: Long term read-only records?

On Wednesday 26 Mar 2003 5:09 pm, Dennis Gearon wrote:

OOOPS,
record by record, I see. Mabye the flag in combination with a view?

That's what I'd do. Don't forget to make sure you still have a user who can
delete the underlying r/o records at some point in the future.
--
Richard Huxton

#5Robert Treat
xzilla@users.sourceforge.net
In reply to: Jason Hihn (#1)
Re: Long term read-only records?

On Wed, 2003-03-26 at 11:34, Jason Hihn wrote:

Is there a way to make a record read-only for months or years? My intent is
that after a cutoff (a program can run making rows r/o) existing records can
no longer be modified without unlocking first. User security is
insufficient, since that only applies to tables. I'd rather not have to
maintain a R/O flag (or date) in code, because it relies on correct,
voluntary implementation every time. I'd like something more enforceable
then that, and that has me looking to the DBMS

Create a rule or trigger on the table to check the age of a date column
and then either disregard or allow updates.

Robert Treat

#6Jason Hihn
jhihn@paytimepayroll.com
In reply to: Robert Treat (#5)
Re: Long term read-only records?

Thank you all for your help. I've been working with MySQL too long. ;-)

Show quoted text

-----Original Message-----
From: Robert Treat [mailto:xzilla@users.sourceforge.net]
Sent: Thursday, March 27, 2003 3:18 PM
To: Jason Hihn
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Long term read-only records?

On Wed, 2003-03-26 at 11:34, Jason Hihn wrote:

Is there a way to make a record read-only for months or years?

My intent is

that after a cutoff (a program can run making rows r/o)

existing records can

no longer be modified without unlocking first. User security is
insufficient, since that only applies to tables. I'd rather not have to
maintain a R/O flag (or date) in code, because it relies on correct,
voluntary implementation every time. I'd like something more enforceable
then that, and that has me looking to the DBMS

Create a rule or trigger on the table to check the age of a date column
and then either disregard or allow updates.

Robert Treat