Received: from draco.over-yonder.net (draco.over-yonder.net [198.78.58.61]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5O03Da81627 for ; Sat, 23 Jun 2001 20:03:13 -0400 (EDT) (envelope-from gh@over-yonder.net) Received: by draco.over-yonder.net (Postfix, from userid 1012) id 1220962D0A; Sat, 23 Jun 2001 19:03:07 -0500 (CDT) Date: Sat, 23 Jun 2001 19:03:07 -0500 From: GH To: rui zhong Cc: pgsql-general@postgresql.org Subject: Re: question on trigger Message-ID: <20010623190307.A58240@over-yonder.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from rick_rui@hotmail.com on Sat, Jun 23, 2001 at 11:10:58PM -0000 X-OS: FreeBSD X-Archive-Number: 200106/912 X-Sequence-Number: 11487 And you forwarded this to -jdbc because...? On Sat, Jun 23, 2001 at 11:10:58PM -0000, some SMTP stream spewed forth: > Hi,all: > This is my first time to use trigger. I try an example from programmer's > guide. Firstly I save the procedure named trigf.c, then i try to comlile it > by using SQL statement " create function trigf() returns opaque as > '...path_to_so' language 'c' ", then I got error message as " Load of file > /home/postgres/trigf.c failed: invalid ELF header ". I don't know how to > fix this, please help me out. Lots of thanks. As far as I know, you need to compile the function as a dynamic object: from: http://postgresql.crimelabs.net/users-lounge/docs/7.0/user/sql-createfunction.htm obj_file , link_symbol This form of the AS clause is used for dynamically-linked, C language functions when the function name in the C language source code is not the same as the name of the SQL function. The string obj_file is the name of the file containing the dynamically loadable object, and link_symbol, is the object's link symbol which is the same as the name of the function in the C language source code. Where did you find this example? gh