Ticket #5 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Schema-Qualify the _global_ids Sequence

Reported by: guest Owned by: fumanchu
Priority: major Milestone: 1.0
Component: assertions Keywords:
Cc:

Description

And here's another issue I ran into: the "test" schema isn't in my search_path, so nextval('_global_ids') didn't work. The fix:

Index: epic.sql
===================================================================
--- epic.sql	(revision 28)
+++ epic.sql	(working copy)
@@ -254,7 +254,7 @@
  creator        text;
BEGIN
  IF name IS NULL THEN
-    tablename := '_global_' || nextval('_global_ids');
+    tablename := '_global_' || nextval('test._global_ids');
  ELSE
    tablename := name;
  END IF;

Change History

Changed 3 years ago by fumanchu

  • status changed from new to accepted
  • milestone set to 1.0

Changed 3 years ago by fumanchu

  • status changed from accepted to closed
  • resolution set to fixed

Fixed in [33]. However, tests should be preferably be run with test.run_test(name), run_module(modname) or run_all(). The various run_* functions which Epic provides set the search_path for you to include the 'test' schema.

If you must run a test via SELECT * FROM mytest();, you should probably prefix that with SET search_path = 'test', .... Doing so allows tests to be written without prefixing every assert or other test function with 'test', making tests easier to read.

Note: See TracTickets for help on using tickets.