Skip to content

Commit ec7616f

Browse files
committed
Changed the casting for integers on ages. This allows ages older than 2b, but probably requires a second constraint on ages.
1 parent 3607f56 commit ec7616f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

function/ap/explorersearch.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CREATE OR REPLACE FUNCTION ap.explorersearch(_taxonids integer[] DEFAULT NULL::i
1919
_agedirectdate boolean DEFAULT false,
2020
_subdate date DEFAULT NULL::date,
2121
_debug boolean DEFAULT false)
22-
RETURNS TABLE(datasetid integer, datasettype character varying, databasename character varying, minage integer, maxage integer, ageyoungest integer, ageoldest integer, siteid integer, sitename character varying, sitedescription text, notes text, collunithandle character varying, collunitname character varying, latitudenorth double precision, latitudesouth double precision, longitudeeast double precision, longitudewest double precision)
22+
RETURNS TABLE(datasetid integer, datasettype character varying, databasename character varying, minage double precision, maxage double precision, ageyoungest double precision, ageoldest double precision, siteid integer, sitename character varying, sitedescription text, notes text, collunithandle character varying, collunitname character varying, latitudenorth double precision, latitudesouth double precision, longitudeeast double precision, longitudewest double precision)
2323
LANGUAGE plpgsql
2424
AS $function$
2525

@@ -408,7 +408,7 @@ BEGIN
408408

409409
IF _datasettypeid IS NOT NULL THEN
410410
cteDsWhere := cteDsWhere || '
411-
AND ds.DatasetTypeID = ' || _datasettypeid;
411+
AND ds.datasettypeid = ' || _datasettypeid;
412412
END IF;
413413

414414
IF noTaxa = true AND NOT (_ageold IS NULL AND _ageyoung IS NULL) THEN
@@ -459,10 +459,10 @@ BEGIN
459459
ds.datasetid,
460460
dt.datasettype,
461461
cdb.databasename,
462-
ds.minage::integer,
463-
ds.maxage::integer,
464-
ds.ageyoungest::integer,
465-
ds.ageoldest::integer,
462+
ds.minage,
463+
ds.maxage,
464+
ds.ageyoungest,
465+
ds.ageoldest,
466466
ds.siteid,
467467
ds.sitename,
468468
ds.sitedescription,

function/ap/updategpsites.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE OR REPLACE FUNCTION ap.updategpsites()
2+
RETURNS trigger
3+
LANGUAGE plpgsql
4+
AS $function$
5+
BEGIN
6+
REFRESH MATERIALIZED VIEW CONCURRENTLY ap.geopolnames;
7+
RETURN NULL;
8+
END $function$

0 commit comments

Comments
 (0)