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? Should I simply use an "assert"?
#include "postgres.h"
#include
#include
#include
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 ther
At Sat, 21 May 2005 20:13:13 +1000,
Neil Conway wrote:
> > Do "palloc" and "pfree" handle such a case cleanly?
>
> Yes -- they will roll back the current transaction on if there is no
> memory available.
Great. So I just use those.
> You can catch the error via PG_TRY() in 8.0 [...]
Nice, bu
On Fri, May 20, 2005 at 12:22:33PM -0500, Jim C. Nasby wrote:
> > which you could take as requiring us to provide numeric equivalents of
> > every floating-point operator, but I don't find that argument very
> > convincing for operations that are inherently not going to give exact
> > results. The
I have searched for the word synonym through the wholePostrgeSQL 7.42 pdf documentation and all the ocurrencesare from functions redefinitions, and another PostreSQLuser has answered me that it does not support tablessynonyms, so I am with a big problem : How can I writequeries to suport different
"Felix E. Klee" <[EMAIL PROTECTED]> writes:
> 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? Should I simply use an "assert"?
I suspect you're mixing users and schemas, but it's been too long since
I've used Oracle, so I'm not sure. Can you provide a more concrete
example? FWIW, I suspect this is a non-issue with postgresql, since the
only hierarchy of objects is schemas, and you can handle that with
search_path.
On Fri,
At Sat, 21 May 2005 10:30:47 -0400,
Tom Lane wrote:
> BTW, a more future-proof way of doing what you want:
>
> > [...]
>
> is to let the varchar output routine do it:
>
> Datum text_datum = PG_GETARG_DATUM(0);
> char *text;
>
> text = DatumGetCString(DirectFunctionCall1(varcharou