Re: Segmentation fault while COPY in 7.3

Nicolai Tufar <ntufar@apb.com.tr>

From: Nicolai Tufar <ntufar@apb.com.tr>
To: pgsql-general@postgresql.org
Date: 2002-12-01T04:20:50Z
Lists: pgsql-hackers, pgsql-general
While waiting for help I decided to fix my problem by
brute-forcing it. I commented out offending call to pfree()
in src/backend/commands/copy.c at line 671. I may introduced
a memory leak, but it works fine for me now.

Best regards,
Nic.




*** ./src/backend/commands/copy.c.orig	Sun Dec  1 06:02:34 2002
--- ./src/backend/commands/copy.c	Sun Dec  1 06:02:48 2002
***************
*** 668,674 ****
  								  ObjectIdGetDatum(elements[attnum - 1]),
  							Int32GetDatum(attr[attnum - 1]->atttypmod)));
  					CopyAttributeOut(fp, string, delim);
! 					pfree(string);
  				}
  				else
  				{
--- 668,674 ----
  								  ObjectIdGetDatum(elements[attnum - 1]),
  							Int32GetDatum(attr[attnum - 1]->atttypmod)));
  					CopyAttributeOut(fp, string, delim);
! 					/*pfree(string);*/
  				}
  				else
  				{