Re: Further thoughts about warning for costly FK checks - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Further thoughts about warning for costly FK checks
Date
Msg-id Pine.LNX.4.58.0403182353070.2899@sablons.cri.ensmp.fr
Whole thread Raw
In response to Re: Further thoughts about warning for costly FK checks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Dear Tom,

I thought about it... how to solve the contradiction:- backend vs external tool?- new interface? new command? unix?
windows?-compatibility with old/existing interfaces?- plugins, any one can contribute?- don't bother DBA's- communicate
aboutit?
 


My 2 pence idea of the day (for free):


CREATE SCHEMA pg_advisor;

CREATE VIEW pg_advisor.table_without_primary_keys
AS SELECT ... FROM pg_catalog...;
COMMENT ON VIEW pg_advisor.table_without_primary_keys
IS 'hey man, it is considered better to have a primary key on tables...';

CREATE VIEW pg_advisor.costly_ri_checks
AS ...

CREATE VIEW pg_advisor.summary AS
SELECT 'missing primary key declarations', COUNT(*)
FROM pg_advisor.table_without_primary_keys
UNION
SELECT 'costly referencial integrity checks...', COUNT(*)
FROM pg_advisor.costly_ri_checks
UNION
... ;


Then:- it is in the backend, somehow;-)- easy plugin: CREATE VIEW ...;;-)- anyone fluent in SQL and in pg_catalog can
contribute!-ALL existing interfaces are already compatible;-)  I can use psql;-);-)- no one has to look at the views if
hedoes not want to.- you can communicate about it in the new release...- well, we're in a relationnal database, so let
usstay there;-)
 

Good night,

-- 
Fabien Coelho - coelho@cri.ensmp.fr


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: COPY formatting
Next
From: Jon Jensen
Date:
Subject: Re: Authentication drop-down?