0

Hello i have the following parameterized copy statement:

Do $$
Begin 
EXECUTE format(
           'COPY test FROM PROGRAM ''curl "https://example.com/events/123&start_date=%sT000000Z"''',
           '20210331'
        );
End
$$ ;

and i want to know how could i make the parameterized date at the end (20210331) correspond to a day before the current date, for example as of now it would be '20211905'.

0

1 Answer 1

1

You can get that string with

to_char(current_date - 1, 'YYYYDDMM')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.