[postgis-devel] unite_array() error handling

Markus Schaber schabios at logi-track.com
Mon Feb 7 05:56:21 PST 2005


Hi,

I just read in the unite_garray() code, and have a small question
regarding the error handling. Should there be a call to PG_RETURN_NULL()
added after the elog() call in line 238?

		if ( g2 == NULL )
		{
			GEOSdeleteGeometry(g1);
			GEOSdeleteGeometry(geos_result);
			elog(ERROR,"GEOS union() threw an error!");
here -->                PG_RETURN_NULL();
		}

I'm not shure about the elog() sematics (is this a macro that
automatically returns?), but some lines below, PG_RETURN_NULL() is called:

	if ( result == NULL )
	{
		elog(ERROR, "GEOS2POSTGIS returned an error");
		PG_RETURN_NULL(); //never get here
	}

BTW, what's the exact meaning of //never get here? :-)

I'm currently searching for good docs regarding writing PostgreSQL C
extensions. Is the material in the official PG manual the only / best
one available?

Markus

--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios at logi-track.com | www.logi-track.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20050207/f8ed8a36/attachment.sig>


More information about the postgis-devel mailing list