pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cursors for update.., we have to port an informix 9.x appication using cursors for update
4+ messages / 4 participants
[nested] [flat]

* Cursors for update.., we have to port an informix 9.x appication using cursors for update
@ 2005-12-20 19:46  jmadm <jmadm@montevideo.com.uy>
  0 siblings, 2 replies; 4+ messages in thread

From: jmadm @ 2005-12-20 19:46 UTC (permalink / raw)
  To: pgsql-interfaces

We have to port an application from Informix 9 CSQL to Postgres 8.1 
using Ecpg.

Informix application uses cursors for update to lock all the rows 
involved in those cursor. Then an update my occur ussing Current of.

How we can do this with postgres?

Thanks for the reply.
Jorge



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Cursors for update.., we have to port an informix 9.x appication using cursors for update
@ 2005-12-20 21:46  Tom Lane <tgl@sss.pgh.pa.us>
  parent: jmadm <jmadm@montevideo.com.uy>
  1 sibling, 1 reply; 4+ messages in thread

From: Tom Lane @ 2005-12-20 21:46 UTC (permalink / raw)
  To: jmadm@montevideo.com.uy; +Cc: pgsql-interfaces

jmadm <jmadm@montevideo.com.uy> writes:
> We have to port an application from Informix 9 CSQL to Postgres 8.1 
> using Ecpg.

> Informix application uses cursors for update to lock all the rows 
> involved in those cursor. Then an update my occur ussing Current of.

> How we can do this with postgres?

You can use SELECT FOR UPDATE in the cursor, I think.  We don't support
WHERE CURRENT OF, so you'll need an alternative strategy for identifying
the row in the UPDATE command; you could use the table's primary key,
or CTID if you don't mind being quite Postgres-specific.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Cursors for update.., we have to port an informix 9.x appication using cursors for update
@ 2005-12-20 22:11  Jaime Casanova <systemguards@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Jaime Casanova @ 2005-12-20 22:11 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: jmadm@montevideo.com.uy; pgsql-interfaces

On 12/20/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> jmadm <jmadm@montevideo.com.uy> writes:
> > We have to port an application from Informix 9 CSQL to Postgres 8.1
> > using Ecpg.
>
> > Informix application uses cursors for update to lock all the rows
> > involved in those cursor. Then an update my occur ussing Current of.
>
> > How we can do this with postgres?
>
> You can use SELECT FOR UPDATE in the cursor,

in the cursor or instead of the cursor? IIRC, cursors are read only in postgres

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Cursors for update.., we have to port an informix 9.x appication using cursors for update
@ 2005-12-21 18:23  Michael Meskes <meskes@postgresql.org>
  parent: jmadm <jmadm@montevideo.com.uy>
  1 sibling, 0 replies; 4+ messages in thread

From: Michael Meskes @ 2005-12-21 18:23 UTC (permalink / raw)
  To: pgsql-interfaces; jmadm@montevideo.com.uy

Am Dienstag, 20. Dezember 2005 20:46 schrieb jmadm:
> We have to port an application from Informix 9 CSQL to Postgres 8.1
> using Ecpg.
>
> Informix application uses cursors for update to lock all the rows
> involved in those cursor. Then an update my occur ussing Current of.
>
> How we can do this with postgres?

IIRC there used to be some patches on gborg to implement WHERE CURRENT OF. I 
have no idea though whether they work with 8.1.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-12-21 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-20 19:46 Cursors for update.., we have to port an informix 9.x appication using cursors for update jmadm <jmadm@montevideo.com.uy>
2005-12-20 21:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-12-20 22:11   ` Jaime Casanova <systemguards@gmail.com>
2005-12-21 18:23 ` Michael Meskes <meskes@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox