Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-03 Thread Pavel Golub
Hello, Andrew. You wrote: AC On 6/2/2011 11:02 AM, Alvaro Herrera wrote: Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course there's no big

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Merlin. You wrote: MM 2011/6/1 Pavel Golub pa...@microolap.com: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result set, or mark tuple as deleted and this is headache for me. So I checked

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Andrew. You wrote: AC On 6/1/2011 11:43 AM, Pavel Golub wrote: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result set, or mark tuple as deleted and this is headache for me. AC IMHO, this

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello. So having studied the fe-exec.c sources, I came to this conclusion: we may just ignore deleted tuple and it will be destroyed by PQclear automatically, becuase PQclear deals with memory blocks. int PQdeleteTuple(PGresult *src, int tup_num) { if (!src) return NULL;

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2011 at 3:24 AM, Pavel Golub pa...@microolap.com wrote: MM well, you have PQaddTuple, but this was exposed mainly for the purpose MM of building a PQresult from outside the libpq library -- not so much MM to remove the 'constness' property of the PGResult.  I have no MM

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Andrew Chernow
On 6/2/2011 4:28 AM, Pavel Golub wrote: Hello, Andrew. You wrote: AC On 6/1/2011 11:43 AM, Pavel Golub wrote: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result set, or mark tuple as deleted and

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Andrew. You wrote: AC On 6/2/2011 4:28 AM, Pavel Golub wrote: Hello, Andrew. You wrote: AC On 6/1/2011 11:43 AM, Pavel Golub wrote: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Andrew Chernow
AC IMHO, this should be handled by the application. You could track tuples AC removed in an int[] or copy the result set into an application defined AC array of C structures. I've always been under the impression that AC PGresult objects are immutable once delivered to the application. Andrew,

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Alvaro Herrera
Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course there's no big deal with their absence but let's be consistent. I'm not entirely sure

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Alvaro. You wrote: AH Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course there's no big deal with their absence but let's be

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Alvaro Herrera
Excerpts from Merlin Moncure's message of jue jun 02 11:33:28 -0400 2011: On Thu, Jun 2, 2011 at 10:02 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Seems pretty wasteful if you want to delete a single tuple from a large result.  I think if you desired to compact the result to free

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2011 at 10:02 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course there's

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Andrew Chernow
On 6/2/2011 11:02 AM, Alvaro Herrera wrote: Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course there's no big deal with their absence but let's

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2011 at 10:57 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Merlin Moncure's message of jue jun 02 11:33:28 -0400 2011: On Thu, Jun 2, 2011 at 10:02 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Seems pretty wasteful if you want to delete a single

[HACKERS] PQdeleteTuple function in libpq

2011-06-01 Thread Pavel Golub
Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result set, or mark tuple as deleted and this is headache for me. So I checked fe-exec.c sources and wrote this: int PQdeleteTuple(PGresult *src, int

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-01 Thread Merlin Moncure
2011/6/1 Pavel Golub pa...@microolap.com: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result set, or mark tuple as deleted and this is headache for me. So I checked fe-exec.c sources and wrote

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-01 Thread Andrew Chernow
On 6/1/2011 11:43 AM, Pavel Golub wrote: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some record I need refetch result set, or mark tuple as deleted and this is headache for me. IMHO, this should be handled by the