I'm fairly new to PostgreSQL. I'm working with a table that has not had a max-length (character count) enforced in the "title" column. The application needs it to be less than 1000 characters but some fields are at 1200, 1300 etc.
I'm quite familiar with mySql but I'm having a harder time picking up PostgreSQL.
If this was mySql I would so something like:
UPDATE TABLE entries SET title = LEFT(title,1000)
How can I accomplish the same thing with PostgreSQL?
I have phppgadmin and the commmand line at my disposal.
Actually, it's the same in postgresql
UPDATE TABLE entries SET title = LEFT(title,1000)
or you can do something like this
UPDATE TABLE entries SET title = substring(title from 1 for 1000)
Here's the doc about the string functions in postgresql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With