Separating raise notice lines

Поиск
Список
Период
Сортировка
От Radcon Entec
Тема Separating raise notice lines
Дата
Msg-id 997172.2777.qm@web43408.mail.sp1.yahoo.com
обсуждение исходный текст
Ответы Re: Separating raise notice lines  (Craig Ringer <craig@postnewspapers.com.au>)
Re: Separating raise notice lines  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список pgsql-general
I like to use RAISE NOTICE statements to make sure my functions are working correctly.  I just wrote a trigger function that has the following code:
 
    -- We have a new tender.  Find out who it is.
    select into userRecord * from users where users_key = new.tender_key;
    if not found then
 raise exception 'Could not store furnace tender information; no user has a key of %', new.tender_key;
    else
 raise notice 'User name is % %', userRecord.name, chr(10);
    end if;
    -- Now we can store the information.
    insert into furnace_tender_history (area, tender_name, tender_checknum, signin_time, signin_time_utc)
    values (new.area, userRecord.name, userRecord.check_number, current_timestamp, current_timestamp at time zone 'utc');
    raise notice 'History record should be added%', chr(10)::text;
    return new;
I am trying to insert a carriage return character (chr(10)) in the user name notice so that any subsequent notices will appear on separate lines.  However, when I use a query to update a field that will fire this trigger, the Messages tab contains this:
 
NOTICE:  User name is capsNOTICE:  History record should be added
Query returned successfully: 1 rows affected, 16 ms execution time.
How can I get the notices to appear on separate lines?
 
Thanks very much!
 
RobR

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: help with data recovery from injected UPDATE
Следующее
От: Jack Orenstein
Дата:
Сообщение: Query optimizer & prepared statements