Postgresql: Remove last char in text-field if the column ends with minus sign - Mailing list pgsql-general

From Sarang Dave
Subject Postgresql: Remove last char in text-field if the column ends with minus sign
Date
Msg-id AANLkTik+FOcjkiirmZx-Ebq+rn1k56b_+-bLYxjn9eto@mail.gmail.com
Whole thread Raw
Responses Re: Postgresql: Remove last char in text-field if the column ends with minus sign  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general

Hello sir,

I want to remove the last char in a column if it ends with the minus sign. How could I do this in postgresql?

For example:


sdfs-dfg4t-etze45z5z- => sdfs-dfg4t-etze45z5z
gsdhfhsfh-rgertggh
=> stay untouched

Is there an easy syntax I can use?

Thanking You.

With Regards,
Sarang Dave

pgsql-general by date:

Previous
From: "felipe@informidia.com.br"
Date:
Subject: When the trigger is called my application is awaiting the finish
Next
From: Anupama
Date:
Subject: Plperl caching prepared queries and cleanup