Re: Segmentation fault while COPY in 7.3 - Mailing list pgsql-general

From Nicolai Tufar
Subject Re: Segmentation fault while COPY in 7.3
Date
Msg-id Pine.GSO.4.10.10212010613570.27674-100000@prana
Whole thread Raw
In response to Segmentation fault while COPY in 7.3  ("Nicolai Tufar" <ntufar@apb.com.tr>)
List 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
                  {



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: USAGE on schema allowed by default?
Next
From: Tom Lane
Date:
Subject: Re: returning CHAR from C function