Search Postgresql Archives

Re: Exception Handling in C-Language Functions?

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

 



Felix E. Klee wrote:
I have the created a C-Language function (code is below).  Now, I
wonder: How do I handle exceptions, for example if malloc cannot assign
the necessary memory?  Do "palloc" and "pfree" handle such a case
cleanly?

Yes -- they will roll back the current transaction on if there is no memory available. You can catch the error via PG_TRY() in 8.0, although in the case of OOM there isn't probably a lot your exception handler could do...


-Neil

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

[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