Re: Removing terminal period from varchar string in table column - Mailing list pgsql-general

From Thom Brown
Subject Re: Removing terminal period from varchar string in table column
Date
Msg-id CAA-aLv4cHmb=0aYm72z=HT93NR6=L8uHVTB92siQONX+7QT6yg@mail.gmail.com
Whole thread Raw
In response to Removing terminal period from varchar string in table column  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Removing terminal period from varchar string in table column
List pgsql-general
On Tue, 15 Jul 2025, 18:30 Rich Shepard, <rshepard@appl-ecosys.com> wrote:
I want to remove the terminal period '.' from the varchar strings in the
'company_name' column in all rows with that period in the companies table.

I've looked at trim(), translate(), "substr(company_name 1,
length(compan_name) - 1)", and a couple of other functions and am unsure how
best to do this without corrupting the database table.

There are various options, but perhaps just use rtrim.

rtrim(company_name, '.')


Thom

pgsql-general by date:

Previous
From: Jeff Ross
Date:
Subject: Re: Removing terminal period from varchar string in table column
Next
From: Rich Shepard
Date:
Subject: Re: Removing terminal period from varchar string in table column