<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Unable to create a C language function"]]></title>
		<link>http://forums.enterprisedb.com/posts/list/3.page</link>
		<description><![CDATA[Latest messages posted in the topic "Unable to create a C language function"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Unable to create a C language function</title>
				<description><![CDATA[ I'm trying to get a feel for creating a function in C, but am encountering a problem. I'm working on Solaris, and according to 'pg_config --version' am working with a Postgres 8.1.18 database. 'pg_config --includedir' gives me /usr/include/pgsql.<br /> <br /> If I set my -I flags to that directory and it server subdirectory I am able to compile a simple c file into a .so. However when I try to 'create or replace function' using that .so I get an error that it is missing a magic block. I tried to include:<br /> <br /> #ifdef PG_MODULE_MAGIC<br /> PG_MODULE_MAGIC;<br /> #endif<br /> <br /> in the .c file, but it didn't help. grep of that directory finds no files that contain PG_MODULE_MAGIC.<br /> <br /> I did find /usr/postgres/8.2/include and /usr/postgres/8.3/include directories though, and tried compiling against them. Using 8.2, when I create the function I get an "incompatible library" magic block mismatch error. But if I compile against 8.3 the error states "Server: 8.2, Library: 8.3".<br /> <br /> I am really at a loss how to resolve this problem. Can anyone recommend a solution?<br /> <br /> Thanks,<br /> Dave D]]></description>
				<guid isPermaLink="true">http://forums.enterprisedb.com/posts/preList/2427/9147.page</guid>
				<link>http://forums.enterprisedb.com/posts/preList/2427/9147.page</link>
				<pubDate><![CDATA[Thu, 2 Sep 2010 14:33:43]]> GMT</pubDate>
				<author><![CDATA[ Dave_Derry]]></author>
			</item>
			<item>
				<title>Re:Unable to create a C language function</title>
				<description><![CDATA[ It's more like a incompatibility issue.<br /> <br /> Please share the code. Let me see if I can make it workable for PG8.4.]]></description>
				<guid isPermaLink="true">http://forums.enterprisedb.com/posts/preList/2427/9170.page</guid>
				<link>http://forums.enterprisedb.com/posts/preList/2427/9170.page</link>
				<pubDate><![CDATA[Sun, 12 Sep 2010 08:25:45]]> GMT</pubDate>
				<author><![CDATA[ Vibhor_K]]></author>
			</item>
			<item>
				<title>Re:Unable to create a C language function</title>
				<description><![CDATA[ Yep, definitely a compatibility issue. I didn't mention that we aren't running on a raw PostGreSQL system, but are on Greenplum. With some more searching and experimenting I found that if I build against /usr/local/greenplum-db-3.3.6.1/include/postgresql I am able to create the function and execute it. Right now it doesn't do anything other than a simple select, but at least I now have managed to do that much.<br /> <br /> Thanks,<br /> Dave]]></description>
				<guid isPermaLink="true">http://forums.enterprisedb.com/posts/preList/2427/9178.page</guid>
				<link>http://forums.enterprisedb.com/posts/preList/2427/9178.page</link>
				<pubDate><![CDATA[Wed, 15 Sep 2010 11:04:44]]> GMT</pubDate>
				<author><![CDATA[ Dave_Derry]]></author>
			</item>
	</channel>
</rss>
