let's say I have a table in a postgres db with DDL such as:
CREATE TABLE personnel_data
(
ID serial primary key,
NAME varchar(50),
EMAIL_ADDRESS varchar(20),
last_updated timestamp
);
now i wish to run a query which will alter the table and convert all column names to completely lowercase. my hunch tells me i need to do something like this at the individual column level, but this clearly cumbersome:
ALTER TABLE personnel_data
RENAME COLUMN ID to id;
my question, then, is how can i create an ALTER statement to change all column names to be lowercase (using lower() ??) in one query?
Thank you!