specify fspr not null so that a left join null result forces it to bomb

This commit is contained in:
Paul Trowbridge 2018-09-20 22:39:34 -04:00
parent e6dc7f154b
commit de2fdc869f
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ CREATE TABLE evt.gl (
,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP ,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP
--populates by trigger join to evt.fspr --populates by trigger join to evt.fspr
,tstmp timestamptz ,tstmp timestamptz
,fspr ltree REFERENCES evt.fspr (id) ,fspr ltree NOT NULL REFERENCES evt.fspr (id)
,amount numeric (12,2) ,amount numeric (12,2)
,glline INT ,glline INT
,bprkeys JSONB ,bprkeys JSONB

View File

@ -1,5 +1,5 @@
--------------------------relational ledger------------------------------------------ --------------------------relational ledger------------------------------------------
--DROP TABLE evt.gl
CREATE TABLE evt.gl ( CREATE TABLE evt.gl (
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
,bprid INT REFERENCES evt.bpr (id) ,bprid INT REFERENCES evt.bpr (id)
@ -7,7 +7,7 @@ CREATE TABLE evt.gl (
,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP ,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP
--populates by trigger join to evt.fspr --populates by trigger join to evt.fspr
,tstmp timestamptz ,tstmp timestamptz
,fspr ltree REFERENCES evt.fspr (id) ,fspr ltree NOT NULL REFERENCES evt.fspr (id)
,amount numeric (12,2) ,amount numeric (12,2)
,glline INT ,glline INT
,bprkeys JSONB ,bprkeys JSONB

View File