I'd like to take a dump of schema of redshift and do some comparisons among different environments.
unload('select * from pg_table_def') to 's3://blah/blah/stage.txt' credentials 'aws_access_key_id=XXXXX;aws_secret_access_key=XXXXXX' parallel off allowoverwrite manifest; But the code above throws me the following error.
INFO: Function "format_type(oid,integer)" not supported. INFO: Function "pg_table_is_visible(oid)" not supported. ERROR: Specified types or functions (one per INFO message) not supported on Redshift tables. Any idea how to make this work ? or is there any way other way to get the schema. i need to know sort key and dist key information as well.
pg_table_defrows to a temp table, and unloading that, but I can't figure out how to copy that leader node table into a temp table either!