patch (for 9.1) string functions

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема patch (for 9.1) string functions
Дата
Msg-id 162867791003090630w2b2ad42fxc360568f1de6fee3@mail.gmail.com
обсуждение исходный текст
Ответы Re: patch (for 9.1) string functions  ("David E. Wheeler" <david@kineticode.com>)
Re: patch (for 9.1) string functions  (Yeb Havinga <yebhavinga@gmail.com>)
Re: patch (for 9.1) string functions  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Hello

this patch contains a string formatting function "format"

postgres=# select format('some message: % (current user: %)',
current_date, current_user);
                     format
------------------------------------------------
 some message: 2010-03-09 (current user: pavel)
(1 row)

this patch add new contrib module string functions - contains mainly
sprintf function:

postgres=# select sprintf('some message: %10s (%10s)', current_date,
current_user);
                sprintf
---------------------------------------
 some message: 2010-03-09 (     pavel)
(1 row)

postgres=# select sprintf('some message: %10s (%-10s)', current_date,
current_user);
                sprintf
---------------------------------------
 some message: 2010-03-09 (pavel     )
(1 row)


some string variadic functions

postgres=# select concat('ahaha',10,null,current_date, true);
         concat
------------------------
 ahaha,10,,2010-03-09,t
(1 row)

postgres=# select concat_sql('ahaha',10,null,current_date, true);
           concat_sql
--------------------------------
 'ahaha',10,NULL,'2010-03-09',t
(1 row)

postgres=# select concat_json('ahaha'::text,10,null,current_date, true);
            concat_json
-----------------------------------
 "ahaha",10,null,"2010-03-09",true
(1 row)


and some basic text function rvrs, left, right.

Regards
Pavel Stehule

Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Augment WAL records for btree delete with GetOldestXmin() to
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: machine-readable pg_controldata?