add remove split language chart show hidden hide
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
1 rows affected
1 rows affected
ERROR:  function aggregate_validity(country, bigint) does not exist
LINE 5:      aggregate_validity(country, airport.country_key) AS for...
             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  CREATE TEMP TABLE lookup_breach ON COMMIT DROP AS
					   SELECT airport.entity_id AS source_entry_id, -- The Id of the source entry
					airport.country_key AS foreing_entry_id, -- The id of the foreing entry
           			airport.valid AS source_entry_valid, -- the validity period of the source entry
					aggregate_validity(country, airport.country_key) AS foreing_entry_valid, -- the validity period of the foreing entry
					aggregate_validity(country, airport.country_key) <@ airport.valid as in_lifespan
           			FROM country, airport
           			WHERE airport.country_key = ANY($1)
                    AND airport.country_key = country_registration.entity_id
           			AND airport.registration @> now()::timestamp
           			GROUP BY airport.country_key, 
				   	airport.entity_id,airport.valid,
					country.valid
CONTEXT:  PL/pgSQL function ingoing_outgoing_reference_integrity_breach(text,bigint[]) line 33 at EXECUTE