Re: cursor "x" does not exist

From: rob stone <floriparob(at)gmail(dot)com>
To: Bob Jones <r(dot)a(dot)n(dot)d(dot)o(dot)m(dot)d(dot)e(dot)v(dot)4+postgres(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: cursor "x" does not exist
Date: 2018-04-15 12:15:23
Message-ID: 1523794523.3515.6.camel@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Bob,

On Sat, 2018-04-14 at 15:44 +0100, Bob Jones wrote:
> Hello,
>
>
>
> P.S. As a side-question, if anyone here has experience in using
> Postgres as a backend to PHP, are refcursors the way to go or should
> I
> be thinking of SETOF or other return styles ?
>

If you have a business requirement along the lines of "display all
outstanding orders for a customer" it is best to create a view that
serves that purpose. Then all you need to code is a "select * from
v_outstanding_orders where customer_id = $1";
If there are any outstanding orders you can page through the
associative array returned by the query in order to display the
results.

HTH,
Rob

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A A 2018-04-15 12:34:57 Re: Can a broken Postgresql data directory be reconstructed without losing data?
Previous Message Ricardo Martin Gomez 2018-04-15 11:43:56 Re: Can a broken Postgresql data directory be reconstructed without losing data?