Skip site navigation (1) Skip section navigation (2)

Re: dblink - custom datatypes NOW work :)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Mark Gibson <gibsonm(at)cromwell(dot)co(dot)uk>,pgsql-patches(at)postgresql(dot)org
Subject: Re: dblink - custom datatypes NOW work :)
Date: 2004-02-23 03:15:07
Message-ID: 20327.1077506107@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches
Joe Conway <mail(at)joeconway(dot)com> writes:
> I'd like to consider the attached a bugfix and apply for the upcoming 
> 7.3.6 and 7.4.2 releases, as well as cvs tip. Any comments/objections? 

Two nitpicks (each applying in 2 places):

> ! 			if (!rsinfo)
> ! 				ereport(ERROR,
> ! 						(errcode(ERRCODE_SYNTAX_ERROR),
> ! 						 errmsg("returning setof record is not " \
> ! 								"allowed in this context")));
> ! 

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?  Compare the code in functions.c:

			ReturnSetInfo *rsi = (ReturnSetInfo *) fcinfo->resultinfo;

			if (rsi && IsA(rsi, ReturnSetInfo))
				rsi->isDone = ExprEndResult;
			else
				ereport(ERROR,
						(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
						 errmsg("set-valued function called in context that cannot accept a set")));

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

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-02-23 03:41:40
Subject: Re: Too-many-files errors on OS X
Previous:From: Joe ConwayDate: 2004-02-23 01:21:23
Subject: Re: dblink - custom datatypes NOW work :)

pgsql-patches by date

Next:From: Tom LaneDate: 2004-02-23 04:32:00
Subject: Re: [GENERAL] dblink: rollback transaction
Previous:From: Joe ConwayDate: 2004-02-23 02:03:08
Subject: Re: [GENERAL] dblink: rollback transaction

pgsql-general by date

Next:From: Tom LaneDate: 2004-02-23 04:32:00
Subject: Re: [GENERAL] dblink: rollback transaction
Previous:From: Joe ConwayDate: 2004-02-23 02:03:08
Subject: Re: [GENERAL] dblink: rollback transaction

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group