BUG #3435: problem with substring function

Поиск
Список
Период
Сортировка
От Carlos Quintero
Тема BUG #3435: problem with substring function
Дата
Msg-id 200707100955.l6A9t7LL063548@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #3435: problem with substring function  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      3435
Logged by:          Carlos Quintero
Email address:      carlos.quintero.sspa@juntadeandalucia.es
PostgreSQL version: 8.2.4
Operating system:   Linux RedHat Enterprise 3
Description:        problem with substring function
Details:

Hi,

I like to use a numerical expression as parameter for the substring
function, but it works always as i use regular expressions. Please, try
this:

select substring('1234' from to_number('3', '999999') for 3);

What returns a empty string:

 substring
-----------

(1 fila)

But the right result must be this:

select substring('1234' from 3 for 3);

 substring
-----------
 34
(1 fila)

If i use other numbers, i got even some errors:

select substring('1234' from to_number('33', '999999') for 3);

ERROR:  la expresión regular no es válida: invalid backreference number
CONTEXTO:  función SQL «substring» en la sentencia 1

This is a sample, really i like to use an expression using date_part() as
the first parameter for substring.


Best Regards,
Carlos

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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: numeric stddev_pop and var_pop are wrong
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: BUG #3435: problem with substring function