Commit dfdb2e5f authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Remove non-portable queries by replacing getpgusername() with a constant

 string.
parent 4aa0e645
...@@ -944,14 +944,14 @@ QUERY: CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data ...@@ -944,14 +944,14 @@ QUERY: CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data
DO INSERT INTO shoelace_log VALUES ( DO INSERT INTO shoelace_log VALUES (
NEW.sl_name, NEW.sl_name,
NEW.sl_avail, NEW.sl_avail,
getpgusername(), 'Al Bundy',
'epoch'::text 'epoch'::text
); );
QUERY: UPDATE shoelace_data SET sl_avail = 6 WHERE sl_name = 'sl7'; QUERY: UPDATE shoelace_data SET sl_avail = 6 WHERE sl_name = 'sl7';
QUERY: SELECT * FROM shoelace_log; QUERY: SELECT * FROM shoelace_log;
sl_name |sl_avail|log_who|log_when sl_name |sl_avail|log_who |log_when
----------+--------+-------+-------- ----------+--------+--------+--------
sl7 | 6|postgres|epoch sl7 | 6|Al Bundy|epoch
(1 row) (1 row)
QUERY: CREATE RULE shoelace_ins AS ON INSERT TO shoelace QUERY: CREATE RULE shoelace_ins AS ON INSERT TO shoelace
...@@ -1019,12 +1019,12 @@ sl6 | 20|brown | 0.9|m | 90 ...@@ -1019,12 +1019,12 @@ sl6 | 20|brown | 0.9|m | 90
(8 rows) (8 rows)
QUERY: SELECT * FROM shoelace_log; QUERY: SELECT * FROM shoelace_log;
sl_name |sl_avail|log_who|log_when sl_name |sl_avail|log_who |log_when
----------+--------+-------+-------- ----------+--------+--------+--------
sl7 | 6|postgres|epoch sl7 | 6|Al Bundy|epoch
sl3 | 10|postgres|epoch sl3 | 10|Al Bundy|epoch
sl6 | 20|postgres|epoch sl6 | 20|Al Bundy|epoch
sl8 | 21|postgres|epoch sl8 | 21|Al Bundy|epoch
(4 rows) (4 rows)
QUERY: CREATE VIEW shoelace_obsolete AS QUERY: CREATE VIEW shoelace_obsolete AS
......
...@@ -594,12 +594,16 @@ SELECT * FROM shoe_ready WHERE total_avail >= 2; ...@@ -594,12 +594,16 @@ SELECT * FROM shoe_ready WHERE total_avail >= 2;
log_when datetime -- when log_when datetime -- when
); );
-- Want "log_who" to be CURRENT_USER,
-- but that is non-portable for the regression test
-- - thomas 1999-02-21
CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data
WHERE NEW.sl_avail != OLD.sl_avail WHERE NEW.sl_avail != OLD.sl_avail
DO INSERT INTO shoelace_log VALUES ( DO INSERT INTO shoelace_log VALUES (
NEW.sl_name, NEW.sl_name,
NEW.sl_avail, NEW.sl_avail,
getpgusername(), 'Al Bundy',
'epoch'::text 'epoch'::text
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment