Skip site navigation (1) Skip section navigation (2)

Re: Advice Needed

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Advice Needed
Date: 2003-02-27 20:20:10
Message-ID: 3E5E72FA.6060304@esc1.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Tom,

Thanks for your response. I've considered you comments and I've been 
doing some experimenting with concurrent record updates. I now see what 
you mean in your comment. I've been executing all the queries using 
PQexec. As you well know, PQexec just sits and waits when another 
transaction has hold of the row. I'm wondering if I should use the 
Asynchronous Query routines to manage this. I've got to be able to get 
feedback to the user and give them the ability to abort the transaction. 
Based on what I've been reading it seems the the Asynchronous routines 
would work. What is your response to this? Also, I can't find any code 
examples at all on how to implement the routines. I can find some 
limited discussions about it, but no examples. I could figure it all out 
with trial and error but would like to skip that if possible. Do you 
know where I can find some code examples?

Thanks...

Tom Lane wrote:

>Terry Lee Tucker <terry(at)esc1(dot)com> writes:
>  
>
>>[snip]
>>1.    Does this model make sense based on your work with libpq-fe and 
>>postgres?
>>    
>>
>
>Yes, it looks pretty standard.  But you need to think harder about
>exactly what you intend to do when two people try to edit the same
>record concurrently.  ("Use a cursor" does not answer that question
>at all.)  That's a bit off-topic for pgsql-interfaces though; I'd
>recommend discussing it in pgsql-sql.
>
>  
>
>>2.    We are only using a binary cursor for the edit operation. Does 
>>this make sense?
>>    
>>
>
>Not really.  I'd not bother with binary cursors at all.  You're just
>opening yourself up to portability problems, and you're not saving
>anything meaningful when you're fetching just one row.
>
>			regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>  
>

-- 
Sparta, NC 28675 USA
336.372.6812
http://www.esc1.com




In response to

pgsql-interfaces by date

Next:From: dhoubrechtsDate: 2003-02-27 20:56:09
Subject: use off geometric types
Previous:From: Wei WengDate: 2003-02-27 18:05:07
Subject: Re: debug a mess

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group