Re: dblink - custom datatypes NOW work :) - Mailing list pgsql-patches

From Joe Conway
Subject Re: dblink - custom datatypes NOW work :)
Date
Msg-id 403AEB07.2080109@joeconway.com
Whole thread Raw
In response to Re: dblink - custom datatypes NOW work :)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Two nitpicks (each applying in 2 places):

> First, testing for null rsinfo isn't sufficient, since the resultinfo
> mechanism could be used for other things; you need an IsA test too.
> Second, is "syntax error" really the most appropriate classification for
> this?

> (Also, the errmsg text seems a bit out of line with the wording of
> comparable errors, but I can't offer better text offhand.)

Thanks for the feedback, Tom. Here's what I ended up with:

     if (!rsinfo || !IsA(rsinfo, ReturnSetInfo))
         ereport(ERROR,
                 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                 errmsg("function returning record called in context "
                        "that cannot accept type record")));

Joe

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: client_encoding in dump file
Next
From: Joe Conway
Date:
Subject: Re: [GENERAL] dblink: rollback transaction