Angel
Angel

Reputation: 79

How do I convert all columns to proper case/title case on PostgreSQL?

I understand that in order to upper/lower -case all fields in a specific column, I will need to use the following syntax:

UPDATE my_table
SET desired_column = lower(desired_column);

but what if I want to proper/title case my entire data set?

Thanks!

Upvotes: 3

Views: 4958

Answers (1)

Fahmi
Fahmi

Reputation: 37473

Use initcap function:

UPDATE my_table
SET desired_column = initcap(product_name);

Upvotes: 4

Related Questions