Re: possible replace() bug - postgres 7.3.1

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Ryan Mahoney <ryan(at)paymentalliance(dot)net>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: possible replace() bug - postgres 7.3.1
Date: 2003-11-09 21:51:25
Message-ID: 1068414685.4486.1.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Ryan Mahoney kirjutas N, 06.11.2003 kell 23:03:
> I am running PostgreSQL 7.3.1 on i686-pc-linux-gnu, compiled by GCC 2.96
>
> the following query fails:
>
> SELECT 'UPDATE pa_sales_lead SET details = COALESCE(details, \'\') ||
> \'' || replace(data, '\'', '\'\'') || '\' WHERE foreign_sales_lead_id =
> \'' || id || '\';' FROM temp_sales_lead ORDER BY id, row LIMIT 10;
>
> with the error:
>
> ERROR: repalloc: invalid request size 1073741824
>
> but, the following query (without replace):
> SELECT 'UPDATE pa_sales_lead SET details = COALESCE(details, \'\') ||
> \'' || data || '\' WHERE foreign_sales_lead_id = \'' || id || '\';' FROM
> temp_sales_lead ORDER BY id, row LIMIT 10;
>
> works just fine, producing output like:
>
> UPDATE pa_sales_lead SET details = COALESCE(details, '') || 'EMPLOY: 50'
> WHERE foreign_sales_lead_id = '10000004';
>
> any ideas?

what does just

SELECT replace(data, '\'', '\'\'')
FROM temp_sales_lead
ORDER BY id, row LIMIT 10;

produce ?

----------------
Hannu

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-11-09 22:38:13 Re: possible replace() bug - postgres 7.3.1
Previous Message monu agrawal 2003-11-09 21:49:42 disk access measurment

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2003-11-09 21:56:51 Re: UPPER()/LOWER() and UTF-8
Previous Message Peter Eisentraut 2003-11-09 20:51:31 Re: NetBSD/acorn32