8000 Remove non-portable queries by replacing getpgusername() with a constant · postgrespro/postgres_cluster@dfdb2e5 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dfdb2e5

Browse files
author
Thomas G. Lockhart
committed
Remove non-portable queries by replacing getpgusername() with a constant
string.
1 parent 4aa0e64 commit dfdb2e5

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/test/regress/expected/rules.out

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -944,14 +944,14 @@ QUERY: CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data
944944
DO INSERT INTO shoelace_log VALUES (
945945
NEW.sl_name,
946946
NEW.sl_avail,
947-
getpgusername(),
947+
'Al Bundy',
948948
'epoch'::text
949949
);
950950
QUERY: UPDATE shoelace_data SET sl_avail = 6 WHERE sl_name = 'sl7';
951951
QUERY: SELECT * FROM shoelace_log;
952-
sl_name |sl_avail|log_who|log_when
953-
----------+--------+-------+--------
954-
sl7 | 6|postgres|epoch
952+
sl_name |sl_avail|log_who |log_when
953+
----------+--------+--------+--------
954+
sl7 | 6|Al Bundy|epoch
955955
(1 row)
956956

957957
QUERY: CREATE RULE 10000 shoelace_ins AS ON INSERT TO shoelace
@@ -1019,12 +1019,12 @@ sl6 | 20|brown | 0.9|m | 90
10191019
(8 rows)
10201020

10211021
QUERY: SELECT * FROM shoelace_log;
1022-
sl_name |sl_avail|log_who|log_when
1023-
----------+--------+-------+--------
1024-
sl7 | 6|postgres|epoch
1025-
sl3 | 10|postgres|epoch
1026-
sl6 | 20|postgres|epoch
1027-
sl8 | 21|postgres|epoch
1022+
sl_name |sl_avail|log_who |log_when
1023+
----------+--------+--------+--------
1024+
sl7 | 6|Al Bundy|epoch
1025+
sl3 | 10|Al Bundy|epoch
1026+
sl6 | 20|Al Bundy|epoch
1027+
sl8 | 21|Al Bundy|epoch
10281028
(4 rows)
10291029

10301030
QUERY: CREATE VIEW shoelace_obsolete AS

src/test/regress/sql/rules.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,16 @@ SELECT * FROM shoe_ready WHERE total_avail >= 2;
594594
log_when datetime -- when
595595
);
596596

597+
-- Want "log_who" to be CURRENT_USER,
598+
-- but that is non-portable for the regression test
599+
-- - thomas 1999-02-21
600+
597601
CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data
598602
WHERE NEW.sl_avail != OLD.sl_avail
599603
DO INSERT INTO shoelace_log VALUES (
600604
NEW.sl_name,
601605
NEW.sl_avail,
602-
getpgusername(),
606+
'Al Bundy',
603607
'epoch'::text
604608
);
605609

0 commit comments

Comments
 (0)
0