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


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to