Re: Removing spaces

Поиск
Список
Период
Сортировка
От Fabrizio Mazzoni
Тема Re: Removing spaces
Дата
Msg-id 20030220194244.7cede80e.veramente@libero.it
обсуждение исходный текст
Ответ на Removing spaces  (Dave Smith <dave.smith@candata.com>)
Список pgsql-general
You could use the trim function in a plpgsql trigger function eg:

CREATE FUNCTION fn_tr_longpad() RETURNS trigger AS '
begin
NEW.a := trim(trailing '' '' from NEW.a);
return NEW;
end; '  LANGUAGE 'plpgsql';

CREATE TRIGGER tst_trigger BEFORE INSERT ON mytable FOR EACH ROW EXECUTE PROCEDURE fn_tr_longpad()

a is the name of the column you have to trim, change it to your needs

Regards,

Fabrizio Mazzoni

В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis Gearon
Дата:
Сообщение: Re: Table Partitioning in Postgres:
Следующее
От: Dan Delaney
Дата:
Сообщение: Dealing with schema in psql utility?