[SQL] copy DELETES to audit table

2000-08-21 Thread jason watkins

I'd like to have a trigger that does something like serialize any row to a
text string, then copys it into an audit table befor allowing the delete...
having an restore function that can deserialize would be nice as well, but
not criticle..

the goal would be to allow a couple people who need the ability to remove
rows the ability to do so, but to not loose the information for a week or
so, so that the choice can be double checked by someone else.

jason watkins




[SQL] drop table if exists

2001-07-03 Thread Jason Watkins

How can I duplicate the behavior of:

DROP TABLE IF EXISTS mytable;

CREATE TABLE mytable (
blah,
blah
);

INSERT INTO mytable
(blah)
VALUES
(blah);

in other words, so that I have a single sql file that restores the database
to a known state.


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



[SQL] Re: drop table if exists

2001-07-03 Thread Jason Watkins

Doesn't work. I like wrapping up the entire file in a transaction so that if
I make a stupid syntax error or the like, I can just do a rollback. Because
of that, the transaction enters abort state. I suppose I can just stop using
transactions and use this method.


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]