Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-08-08 Thread Bruce Momjian

Patch applied by Tom.  Thanks.

---


Karel Zak wrote:
 
  This is new version of SELECT FOR UPDATE NOWAIT patch.
 
   Karel
 
 
 
 On Sat, 2005-06-25 at 08:40 +0200, Hans-Juergen Schoenig wrote:
  yes, i think we can do it in time.
  
  regards,
  
 hans
  
  
  
  Bruce Momjian wrote:
  
  Are you working on a updated version of this?
  
  ---
  
  Bruce Momjian wrote:

  
  Uh, seems the code has drifted too much and now I can't apply this. 
  Would you redo this against current CVS?  Thanks.
  
  ---
  
  Hans-Juergen Schoenig wrote:
  
  
  Folks,
  
  We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.
 
 -- 
 Karel Zak [EMAIL PROTECTED]

[ Attachment, skipping... ]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-08-01 Thread Tom Lane
Karel Zak [EMAIL PROTECTED] writes:
  This is new version of SELECT FOR UPDATE NOWAIT patch.

Applied with revisions.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-07-02 Thread Bruce Momjian
Karel Zak wrote:
 
  This is new version of SELECT FOR UPDATE NOWAIT patch.
 
   Karel
 
 
 
 On Sat, 2005-06-25 at 08:40 +0200, Hans-Juergen Schoenig wrote:
  yes, i think we can do it in time.
  
  regards,
  
 hans
  
  
  
  Bruce Momjian wrote:
  
  Are you working on a updated version of this?
  
  ---
  
  Bruce Momjian wrote:

  
  Uh, seems the code has drifted too much and now I can't apply this. 
  Would you redo this against current CVS?  Thanks.
  
  ---
  
  Hans-Juergen Schoenig wrote:
  
  
  Folks,
  
  We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.
 
 -- 
 Karel Zak [EMAIL PROTECTED]

[ Attachment, skipping... ]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-07-01 Thread Karel Zak

 This is new version of SELECT FOR UPDATE NOWAIT patch.

Karel



On Sat, 2005-06-25 at 08:40 +0200, Hans-Juergen Schoenig wrote:
 yes, i think we can do it in time.
 
 regards,
 
hans
 
 
 
 Bruce Momjian wrote:
 
 Are you working on a updated version of this?
 
 ---
 
 Bruce Momjian wrote:
   
 
 Uh, seems the code has drifted too much and now I can't apply this. 
 Would you redo this against current CVS?  Thanks.
 
 ---
 
 Hans-Juergen Schoenig wrote:
 
 
 Folks,
 
 We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.

-- 
Karel Zak [EMAIL PROTECTED]


pgsql-nowait-07012005.patch.gz
Description: GNU Zip compressed data

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-06-27 Thread Karel Zak
On Fri, 2005-06-24 at 22:32 -0400, Bruce Momjian wrote:
 Are you working on a updated version of this?

I will work on new version during this week.

Karel


 ---
 
 Bruce Momjian wrote:
  
  Uh, seems the code has drifted too much and now I can't apply this. 
  Would you redo this against current CVS?  Thanks.
  
  ---
  
  Hans-Juergen Schoenig wrote:
   Folks,
   
   We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.
   The patch attached to this email contains all the required code 
   including ECPG updates and some documentation.
   It would be nice if this patch would be included in PostgreSQL 8.1
   
 Best regards,
   
 Ewald Geschwinde  Hans-Juergen Schoenig
   
   --
   Cybertec Geschwinde u Schoenig GmbH.
   Schoengrabern 134, A-2020 Hollabrunn, Austria
   Tel: +43/660/816 40 77
   www.cybertec.at, www.postgresql.at
  
  [ text/x-patch is unsupported, treating like TEXT/PLAIN ]
  
   diff -r -c postgresql-8.0.0rc2.orig/doc/src/sgml/ref/select.sgml 
   postgresql-8.0.0rc2/doc/src/sgml/ref/select.sgml
   *** postgresql-8.0.0rc2.orig/doc/src/sgml/ref/select.sgml Sat Nov 27 
   22:27:07 2004
   --- postgresql-8.0.0rc2/doc/src/sgml/ref/select.sgml  Mon Dec 27 
   10:57:05 2004
   ***
   *** 30,36 
 [ ORDER BY replaceable class=parameterexpression/replaceable 
   [ ASC | DESC | USING replaceable 
   class=parameteroperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=parametercount/replaceable | ALL 
   } ]
 [ OFFSET replaceable class=parameterstart/replaceable ]
   ! [ FOR UPDATE [ OF replaceable 
   class=parametertable_name/replaceable [, ...] ] ]
 
 where replaceable class=parameterfrom_item/replaceable can be one 
   of:
 
   --- 30,36 
 [ ORDER BY replaceable class=parameterexpression/replaceable 
   [ ASC | DESC | USING replaceable 
   class=parameteroperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=parametercount/replaceable | ALL 
   } ]
 [ OFFSET replaceable class=parameterstart/replaceable ]
   ! [ FOR UPDATE [ OF replaceable 
   class=parametertable_name/replaceable [, ...] ] [NOWAIT] ]
 
 where replaceable class=parameterfrom_item/replaceable can be one 
   of:
 
   ***
   *** 772,778 
para
 The literalFOR UPDATE/literal clause has this form:
 synopsis
   ! FOR UPDATE [ OF replaceable class=parametertable_name/replaceable 
   [, ...] ]
 /synopsis
/para
 
   --- 772,778 
para
 The literalFOR UPDATE/literal clause has this form:
 synopsis
   ! FOR UPDATE [ OF replaceable class=parametertable_name/replaceable 
   [, ...] ] [NOWAIT]
 /synopsis
/para
 
   ***
   *** 789,796 
 has already locked a selected row or rows, commandSELECT FOR
 UPDATE/command will wait for the other transaction to complete,
 and will then lock and return the updated row (or no row, if the
   ! row was deleted).  For further discussion see xref
   ! linkend=mvcc.
/para
 
para
   --- 789,802 
 has already locked a selected row or rows, commandSELECT FOR
 UPDATE/command will wait for the other transaction to complete,
 and will then lock and return the updated row (or no row, if the
   ! row was deleted).  If the current transaction is not supposed to
   ! wait on other transactions to commit the NOWAIT option can be
   ! used.  If commandSELECT FOR UPDATE NOWAIT/command finds out
   ! that somebody else is holding a lock an error will be thrown.
   ! This will only happen in case of row level locks - if somebody
   ! holds a table lock commandSELECT FOR UPDATE NOWAIT/command
   ! will still wait for concurrent transactions.  For further 
   ! discussion see xref linkend=mvcc.
/para
 
para
   diff -r -c postgresql-8.0.0rc2.orig/doc/src/sgml/sql.sgml 
   postgresql-8.0.0rc2/doc/src/sgml/sql.sgml
   *** postgresql-8.0.0rc2.orig/doc/src/sgml/sql.sgmlMon Nov 15 
   07:32:14 2004
   --- postgresql-8.0.0rc2/doc/src/sgml/sql.sgml Mon Dec 27 10:57:05 2004
   ***
   *** 866,872 
 [ ORDER BY replaceable class=PARAMETERexpression/replaceable 
   [ ASC | DESC | USING replaceable 
   class=PARAMETERoperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=PARAMETERcount/replaceable | ALL 
   } ]
 [ OFFSET replaceable class=PARAMETERstart/replaceable ]
   ! [ FOR UPDATE [ OF replaceable 
   class=PARAMETERclass_name/replaceable [, ...] ] ]
  /synopsis
 /para
 
   --- 866,872 
 [ ORDER BY replaceable class=PARAMETERexpression/replaceable 
   [ ASC | DESC | USING replaceable 
   class=PARAMETERoperator/replaceable 

Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-06-27 Thread Hans-Juergen Schoenig

yes, i think we can do it in time.

   regards,

  hans



Bruce Momjian wrote:


Are you working on a updated version of this?

---

Bruce Momjian wrote:
 

Uh, seems the code has drifted too much and now I can't apply this. 
Would you redo this against current CVS?  Thanks.


---

Hans-Juergen Schoenig wrote:
   


Folks,

We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.
The patch attached to this email contains all the required code 
including ECPG updates and some documentation.

It would be nice if this patch would be included in PostgreSQL 8.1

Best regards,

Ewald Geschwinde  Hans-Juergen Schoenig

--
Cybertec Geschwinde u Schoenig GmbH.
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/660/816 40 77
www.cybertec.at, www.postgresql.at
 


[ text/x-patch is unsupported, treating like TEXT/PLAIN ]

   


diff -r -c postgresql-8.0.0rc2.orig/doc/src/sgml/ref/select.sgml 
postgresql-8.0.0rc2/doc/src/sgml/ref/select.sgml
*** postgresql-8.0.0rc2.orig/doc/src/sgml/ref/select.sgml   Sat Nov 27 
22:27:07 2004
--- postgresql-8.0.0rc2/doc/src/sgml/ref/select.sgmlMon Dec 27 10:57:05 2004
***
*** 30,36 
 [ ORDER BY replaceable class=parameterexpression/replaceable [ ASC | DESC | USING 
replaceable class=parameteroperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=parametercount/replaceable | ALL } ]
 [ OFFSET replaceable class=parameterstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=parametertable_name/replaceable 
[, ...] ] ]
 
 where replaceable class=parameterfrom_item/replaceable can be one of:
 
--- 30,36 

 [ ORDER BY replaceable class=parameterexpression/replaceable [ ASC | DESC | USING 
replaceable class=parameteroperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=parametercount/replaceable | ALL } ]
 [ OFFSET replaceable class=parameterstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=parametertable_name/replaceable 
[, ...] ] [NOWAIT] ]
 
 where replaceable class=parameterfrom_item/replaceable can be one of:
 
***

*** 772,778 
para
 The literalFOR UPDATE/literal clause has this form:
 synopsis
! FOR UPDATE [ OF replaceable class=parametertable_name/replaceable [, 
...] ]
 /synopsis
/para
 
--- 772,778 

para
 The literalFOR UPDATE/literal clause has this form:
 synopsis
! FOR UPDATE [ OF replaceable class=parametertable_name/replaceable [, 
...] ] [NOWAIT]
 /synopsis
/para
 
***

*** 789,796 
 has already locked a selected row or rows, commandSELECT FOR
 UPDATE/command will wait for the other transaction to complete,
 and will then lock and return the updated row (or no row, if the
! row was deleted).  For further discussion see xref
! linkend=mvcc.
/para
 
para

--- 789,802 
 has already locked a selected row or rows, commandSELECT FOR
 UPDATE/command will wait for the other transaction to complete,
 and will then lock and return the updated row (or no row, if the
! row was deleted).  If the current transaction is not supposed to
! wait on other transactions to commit the NOWAIT option can be
! used.  If commandSELECT FOR UPDATE NOWAIT/command finds out
! that somebody else is holding a lock an error will be thrown.
! This will only happen in case of row level locks - if somebody
! holds a table lock commandSELECT FOR UPDATE NOWAIT/command
! will still wait for concurrent transactions.  For further 
! discussion see xref linkend=mvcc.

/para
 
para

diff -r -c postgresql-8.0.0rc2.orig/doc/src/sgml/sql.sgml 
postgresql-8.0.0rc2/doc/src/sgml/sql.sgml
*** postgresql-8.0.0rc2.orig/doc/src/sgml/sql.sgml  Mon Nov 15 07:32:14 2004
--- postgresql-8.0.0rc2/doc/src/sgml/sql.sgml   Mon Dec 27 10:57:05 2004
***
*** 866,872 
 [ ORDER BY replaceable class=PARAMETERexpression/replaceable [ ASC | DESC | USING 
replaceable class=PARAMETERoperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=PARAMETERcount/replaceable | ALL } ]
 [ OFFSET replaceable class=PARAMETERstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=PARAMETERclass_name/replaceable 
[, ...] ] ]
  /synopsis
 /para
 
--- 866,872 

 [ ORDER BY replaceable class=PARAMETERexpression/replaceable [ ASC | DESC | USING 
replaceable class=PARAMETERoperator/replaceable ] [, ...] ]
 [ LIMIT { replaceable class=PARAMETERcount/replaceable | ALL } ]
 [ OFFSET replaceable class=PARAMETERstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=PARAMETERclass_name/replaceable 
[, ...] ] [NOWAIT] ]
  /synopsis
 /para
 
diff -r -c postgresql-8.0.0rc2.orig/src/backend/access/heap/heapam.c postgresql-8.0.0rc2/src/backend/access/heap/heapam.c

*** 

Re: [PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2005-01-03 Thread Bruce Momjian

This has been saved for the 8.1 release:

http:/momjian.postgresql.org/cgi-bin/pgpatches2

---

Hans-Juergen Schoenig wrote:
 Folks,
 
 We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.
 The patch attached to this email contains all the required code 
 including ECPG updates and some documentation.
 It would be nice if this patch would be included in PostgreSQL 8.1
 
   Best regards,
 
   Ewald Geschwinde  Hans-Juergen Schoenig
 
 --
 Cybertec Geschwinde u Schoenig GmbH.
 Schoengrabern 134, A-2020 Hollabrunn, Austria
 Tel: +43/660/816 40 77
 www.cybertec.at, www.postgresql.at


-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[PATCHES] Implementing SELECT FOR UPDATE [NOWAIT]

2004-12-29 Thread Hans-Juergen Schoenig
Folks,
We have implemented SELECT FOR UPDATE NOWAIT for PostgreSQL.
The patch attached to this email contains all the required code 
including ECPG updates and some documentation.
It would be nice if this patch would be included in PostgreSQL 8.1

Best regards,
Ewald Geschwinde  Hans-Juergen Schoenig
--
Cybertec Geschwinde u Schoenig GmbH.
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/660/816 40 77
www.cybertec.at, www.postgresql.at
diff -r -c postgresql-8.0.0rc2.orig/doc/src/sgml/ref/select.sgml postgresql-8.0.0rc2/doc/src/sgml/ref/select.sgml
*** postgresql-8.0.0rc2.orig/doc/src/sgml/ref/select.sgml	Sat Nov 27 22:27:07 2004
--- postgresql-8.0.0rc2/doc/src/sgml/ref/select.sgml	Mon Dec 27 10:57:05 2004
***
*** 30,36 
  [ ORDER BY replaceable class=parameterexpression/replaceable [ ASC | DESC | USING replaceable class=parameteroperator/replaceable ] [, ...] ]
  [ LIMIT { replaceable class=parametercount/replaceable | ALL } ]
  [ OFFSET replaceable class=parameterstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=parametertable_name/replaceable [, ...] ] ]
  
  where replaceable class=parameterfrom_item/replaceable can be one of:
  
--- 30,36 
  [ ORDER BY replaceable class=parameterexpression/replaceable [ ASC | DESC | USING replaceable class=parameteroperator/replaceable ] [, ...] ]
  [ LIMIT { replaceable class=parametercount/replaceable | ALL } ]
  [ OFFSET replaceable class=parameterstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=parametertable_name/replaceable [, ...] ] [NOWAIT] ]
  
  where replaceable class=parameterfrom_item/replaceable can be one of:
  
***
*** 772,778 
 para
  The literalFOR UPDATE/literal clause has this form:
  synopsis
! FOR UPDATE [ OF replaceable class=parametertable_name/replaceable [, ...] ]
  /synopsis
 /para
  
--- 772,778 
 para
  The literalFOR UPDATE/literal clause has this form:
  synopsis
! FOR UPDATE [ OF replaceable class=parametertable_name/replaceable [, ...] ] [NOWAIT]
  /synopsis
 /para
  
***
*** 789,796 
  has already locked a selected row or rows, commandSELECT FOR
  UPDATE/command will wait for the other transaction to complete,
  and will then lock and return the updated row (or no row, if the
! row was deleted).  For further discussion see xref
! linkend=mvcc.
 /para
  
 para
--- 789,802 
  has already locked a selected row or rows, commandSELECT FOR
  UPDATE/command will wait for the other transaction to complete,
  and will then lock and return the updated row (or no row, if the
! row was deleted).  If the current transaction is not supposed to
! wait on other transactions to commit the NOWAIT option can be
! used.  If commandSELECT FOR UPDATE NOWAIT/command finds out
! that somebody else is holding a lock an error will be thrown.
! This will only happen in case of row level locks - if somebody
! holds a table lock commandSELECT FOR UPDATE NOWAIT/command
! will still wait for concurrent transactions.  For further 
! discussion see xref linkend=mvcc.
 /para
  
 para
diff -r -c postgresql-8.0.0rc2.orig/doc/src/sgml/sql.sgml postgresql-8.0.0rc2/doc/src/sgml/sql.sgml
*** postgresql-8.0.0rc2.orig/doc/src/sgml/sql.sgml	Mon Nov 15 07:32:14 2004
--- postgresql-8.0.0rc2/doc/src/sgml/sql.sgml	Mon Dec 27 10:57:05 2004
***
*** 866,872 
  [ ORDER BY replaceable class=PARAMETERexpression/replaceable [ ASC | DESC | USING replaceable class=PARAMETERoperator/replaceable ] [, ...] ]
  [ LIMIT { replaceable class=PARAMETERcount/replaceable | ALL } ]
  [ OFFSET replaceable class=PARAMETERstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=PARAMETERclass_name/replaceable [, ...] ] ]
   /synopsis
  /para
  
--- 866,872 
  [ ORDER BY replaceable class=PARAMETERexpression/replaceable [ ASC | DESC | USING replaceable class=PARAMETERoperator/replaceable ] [, ...] ]
  [ LIMIT { replaceable class=PARAMETERcount/replaceable | ALL } ]
  [ OFFSET replaceable class=PARAMETERstart/replaceable ]
! [ FOR UPDATE [ OF replaceable class=PARAMETERclass_name/replaceable [, ...] ] [NOWAIT] ]
   /synopsis
  /para
  
diff -r -c postgresql-8.0.0rc2.orig/src/backend/access/heap/heapam.c postgresql-8.0.0rc2/src/backend/access/heap/heapam.c
*** postgresql-8.0.0rc2.orig/src/backend/access/heap/heapam.c	Sun Nov 14 03:04:12 2004
--- postgresql-8.0.0rc2/src/backend/access/heap/heapam.c	Mon Dec 27 10:56:52 2004
***
*** 16,21 
--- 16,22 
   *		relation_openrv - open any relation specified by a RangeVar
   *		relation_openr	- open a system relation by name
   *		relation_close	- close any relation
+  *		conditional_relation_open - open with option not to wait
   *		heap_open		- open a heap relation by relation OID
   *		heap_openrv		- open a heap relation specified by a