use the actual column name
This commit is contained in:
parent
c97e92f3bc
commit
66813bb156
@ -39,7 +39,7 @@ SELECT
|
||||
string_agg(
|
||||
'LEFT OUTER JOIN fc.perd '||func||' ON'||
|
||||
$$
|
||||
$$||'(o.'||fkey||' + interval '||format('%L',_interval) ||' )::date <@ '||func||'.drange'
|
||||
$$||'(o.'||format('%I',cname)||' + interval '||format('%L',_interval) ||' )::date <@ '||func||'.drange'
|
||||
,E'\n')
|
||||
INTO
|
||||
_perd_joins
|
||||
@ -75,7 +75,7 @@ SELECT
|
||||
ELSE
|
||||
--use the date key but increment by the target interval
|
||||
--this assumes that the primary key for the func is a date, but it has to be or it wont join anyways
|
||||
'o.'||fkey||' + interval '||format('%L',_interval) ||' AS '||fkey
|
||||
'o.'||format('%I',cname)||' + interval '||format('%L',_interval) ||' AS '||format('%I',cname)
|
||||
END
|
||||
ELSE
|
||||
'o.'||format('%I',cname)
|
||||
|
Loading…
Reference in New Issue
Block a user