I'm trying to create a new schema with todays date in the name. Named like this
select concat('Copy_', replace(now()::date::text,'-',''))
Copy_20181102
So I try:
CREATE SCHEMA concat('Copy_', replace(now()::date::text,'-',''))
AUTHORIZATION postgres;
ERROR: syntax error at or near "(" LINE 1: CREATE SCHEMA concat('Copy_', replace(now()::date::text,'-',... ^ SQL state: 42601 Character: 21
How can I fix this?
replace(now()::date::text,'-','')is better written asto_char(now(), 'yyyymmdd')orto_char(current_date, 'yyyymmdd')- a_horse_with_no_name