View still depends on column even after I have removed the explicit (as well as transitive) dependencies?

Assume I have the following table and view:

CREATE TABLE my_table (a int, b text, c text); CREATE VIEW my_view AS SELECT * FROM my_table WHERE b = 'foo'; 

The table has some data:

INSERT INTO my_table VALUES (1, 'foo', 'first'); INSERT INTO my_table VALUES (2, 'foo', 'second'); INSERT INTO my_table VALUES (3, 'foo', 'third'); 

I realise that column b always has the same value 'foo'. I decide that the entire column is unnecessary, and wish to drop it.

Because I like to be explicit about my dependencies, to make sure I don’t accidentally drop more than I should, I avoid using the CASCADE keyword, opting instead to redefine the dependent view manually:


The view now no longer has any explicit dependency on column b, so the column should be safe to delete.


However, as I try to drop column b, I get the following error message

ERROR:  cannot drop table my_table column b because other objects depend on it DETAIL:  view my_view depends on table my_table column b HINT:  Use DROP ... CASCADE to drop the dependent objects too. 

Why does this error message appear even after removing the dependency on the column to be dropped?

Why my pdf does not integrate to $1$ numerically even though it does analytically?

I’m running a simulation to verify my pdfs integrate to $ 1$ numerically. My problem is that pdfa outputs 1. but pdfg outputs 0.995075. I understand it’s almost $ 1$ but still this slight error affect my subsequent simulations. Is this error resulting from computations? Is it fixable?


a = 9.6117; b = 0.1581;  lamdaA = 0.00001; ha = 100; pta = 1; etaaN = 3.2; etaaL = 3;  lamdaG = 0.001; hg = 60; ptg = 1; etag = 3.6;  PL[rr_] := 1/(1 + a Exp[b (a - 180/\[Pi] ArcTan[ha/rr])])  Eg[rr_] := (pta/ptg)^(2/etaaL) (rr^2 + hg^2)^(etag/etaaL) - ha^2 Ea[rr_] := (ptg/pta)^(2/etag) (rr^2 + ha^2)^(etaaL/etag) - hg^2  frg[rr_] := 2 \[Pi] lamdaG rr Exp[-\[Pi] lamdaG rr^2]; Frg[rr_] := 1 - Exp[-\[Pi] lamdaG rr^2];  fra[rr_] := 2 \[Pi] lamdaA rr Exp[-\[Pi] lamdaA rr^2]; Fra[rr_] := 1 - Exp[-\[Pi] lamdaA rr^2]  intt1[rr_] := PL[rr] fra[rr] ; intt2[rr_] := PL[rr] fra[rr] Frg[Sqrt[Ea[rr]]];  If [Eg[0] > 0 ,  ppa = ( NIntegrate[intt1[t] , {t, 0, \[Infinity]}] -       NIntegrate[intt2[t], {t, Sqrt[Eg[0]], \[Infinity]}]);,  ppa = (NIntegrate[intt2[t], {t, 0, \[Infinity]}]);]  fxa1[xx_] := (PL[xx] fra[xx])/ppa;  fxa2[xx_] := (PL[xx] fra[xx])/ppa (1 - Frg[Sqrt[Ea[xx]]]); fxg1[xx_] := (PL[xx] frg[xx])/(1 - ppa); fxg2[xx_] := ((PL[xx] frg[xx])/(1 - ppa)) (1 - Fra[Sqrt[Eg[xx]]]);  pdfa1 := NIntegrate[fxa1[t], {t, 0, Sqrt[Eg[0]]}] +     NIntegrate[fxa2[t], {t, Sqrt[Eg[0]], \[Infinity]}]; pdfa2 := NIntegrate[fxa2[t], {t, 0, \[Infinity]}];  If[(Eg[0] > 0 ),  pdfa = pdfa1,  pdfa = pdfa2]  pdfg1 := NIntegrate[fxg1[t], {t, 0, Sqrt[Ea[0]]}] +     NIntegrate[fxg2[t], {t, Sqrt[Ea[0]], \[Infinity]}]; pdfg2 := NIntegrate[fxg2[t], {t, 0, \[Infinity]}];  If[(Ea[0] > 0 ),  pdfg = pdfg1,  pdfg = pdfg2]