Trimming a string column in PostgreSQL
In case this helps anyone... I had to figure it out recently and though it isn't hard, it isn't obvious either.
Here's how to truncate a string column in Postgres. Assume the column is of length M where M > N and we want it to be N with simple trim:
alter table T alter column C type varchar(N)The key is that
using substring(C from 1 for N);
C references both the column name (in the first instance) and the value (in the second instance).
1 comments:
Do you know the runescape power leveling, in the game you need the runescape gold. it can help you increase your level. My friends always asked me how to buy runescape accounts, i do not know he spend how much money to buy the runescape money, when i see him in order to play the game and search which the place can buy the cheap runescape power leveling. i also happy with him.
Post a Comment