Search Postgresql Archives

Re: cursor already in use error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> If I add "close crs;" before the function returns, I get this:
>
> SELECT name, testcursor(testid) FROM test;
>  name |           testcursor
> ------+--------------------------------
>  Bob  | -Comment 1-Comment 2-Comment 3
>  Mark | -Comment 1
>  Tom  |
> (3 rows)
>

You got it.
I was closing the cursor at the end of the function, but there were other
possible returns in the middle.
I changed the code to add close before each return and it works like a
charm.

I rushed together the example, or I should have caught that.

Much thanks.
Sim




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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux