"Karl O. Pinc" <kop@meme.com> writes:
> RETURN day_zero + CAST (julian_day || ' days' AS INTERVAL);
That's certainly the hard way. Just use the date + integer operator
(ie, "RETURN day_zero + julian_day").
> day_zero CONSTANT DATE := CAST (0 AS DATE);
Does that really work? I get
regression=# select CAST (0 AS DATE);
ERROR: cannot cast type integer to date
regards, tom lane