create or replace function archive_some_stuff() returns void as $$
declare cutoff timestamptz;
begin
cutoff := now() - '1 day'::interval;
copy (select * from log where end_when < cutoff) to ...
...
Gives me an error that there is column named cutoff. (Other uses of cutoff in queries not inside a copy, iow the delete
fromcommands, work.)
Is there any alternative to just duplicating the now() expression inside every copy?
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice