Re: possible replace() bug - postgres 7.3.1 - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: possible replace() bug - postgres 7.3.1
Date
Msg-id 1068414685.4486.1.camel@fuji.krosing.net
Whole thread Raw
In response to possible replace() bug - postgres 7.3.1  (Ryan Mahoney <ryan@paymentalliance.net>)
Responses Re: possible replace() bug - postgres 7.3.1
List 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_leadORDER BY id, row LIMIT 10; 

produce ?

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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: NetBSD/acorn32
Next
From: Hannu Krosing
Date:
Subject: Re: UPPER()/LOWER() and UTF-8