Ticket #167 (closed bug: fixed)

Opened 22 months ago

Last modified 22 months ago

Missing RULEs for VIEWs in SQL pane

Reported by: brsa Owned by: gleu
Priority: minor Milestone: 1.10.3
Component: pgadmin Version: 1.10
Keywords: browser sqlpane Cc:
Platform: all

Description

SQL pane:
RULEs are added to the SQL of TABLEs, but they are missing with VIEWs.
That is inconsistent at the least. If the general guideline is: the displayed SQL shall be able to recreate an identical object (or so is my understanding, at least with identical settings), it's a bug.
Demo:

-- TABLE --
-- i say --

CREATE TABLE test (id integer);
CREATE TABLE test2 (id integer);

CREATE RULE on_delete AS

ON DELETE
TO test
DO INSTEAD
DELETE FROM test2
WHERE test2.id = old.id;

-- pgadmin says --

-- Table: test

-- DROP TABLE test;

CREATE TABLE test
(

id integer

)
WITH (

OIDS=FALSE

);
ALTER TABLE test OWNER TO postgres;

-- Rule: "on_delete ON test"

-- DROP RULE on_delete ON test;

CREATE OR REPLACE RULE on_delete AS

ON DELETE TO test DO INSTEAD DELETE FROM test2

WHERE test2.id = old.id;
-- note the attached RULE


-- VIEW --
-- I say --

CREATE VIEW v_test AS
SELECT * FROM test;

CREATE RULE on_delete AS

ON DELETE
TO v_test
DO INSTEAD
DELETE FROM test2
WHERE test2.id = old.id;

-- pgadmin says --

CREATE OR REPLACE VIEW v_test AS

SELECT test.id

FROM test;

(...)

-- note the missing RULE!

Change History

Changed 22 months ago by gleu

  • owner changed from dpage to gleu
  • keywords browser sqlpane added; SQL pane removed
  • version changed from trunk to 1.10
  • status changed from new to assigned

Changed 22 months ago by gleu

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to 1.10.3

Fixed in r8264 and r8265.

Note: See TracTickets for help on using tickets.