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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Query on support for trigger functions defined in a Shared librar y in Windows


  • From: Mehul Doshi-A20614 <mehul(at)motorola(dot)com>
  • To: pgsql-hackers-win32(at)postgresql(dot)org
  • Cc: Mehul Doshi-A20614 <mehul(at)motorola(dot)com>
  • Subject: Query on support for trigger functions defined in a Shared librar y in Windows
  • Date: Mon, 25 Jul 2005 20:37:03 +0530
  • Message-id: <45AAAAED8B10F547878F52FE15C57C5D15D049@zin24exm03.corp.mot.com> <text/plain>

Hi,

I would like to know whether the native Windows version of PostgreSQL
(version 8.0.0) 
supports trigger functions defined in shared libraries. Specifically, I am
trying to port a
Linux shared object used as the snippet below shows to Windows:

CREATE FUNCTION foo() returns trigger AS '/path/to/sharedlib.so' LANGUAGE C;

Are DLLs supported in a similar context in Windows?

What do I need to do to port such code?

My initial attempts resulted in a failure. I created the DLL and attempted
to run the SQL CREATE FUNCTION which specified the Windows path
to the DLL. However the server died without any clueful messages.

psql:d:/test.sql:4: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
psql:d:/test.sql:4: connection to server was lost

The pg_log logs the following:
2005-07-25 20:30:26 DEBUG:  InitPostgres
2005-07-25 20:30:26 DEBUG:  StartTransaction
2005-07-25 20:30:26 DEBUG:  name: unnamed; blockState:       DEFAULT; state:
INPROGR, xid/subid/cid: 116556/1/0, nestlvl: 1, children: <>
2005-07-25 20:30:26 DEBUG:  CommitTransaction
2005-07-25 20:30:26 DEBUG:  name: unnamed; blockState:       STARTED; state:
INPROGR, xid/subid/cid: 116556/1/0, nestlvl: 1, children: <>
2005-07-25 20:30:26 DEBUG:  StartTransactionCommand
2005-07-25 20:30:26 DEBUG:  StartTransaction
2005-07-25 20:30:26 DEBUG:  name: unnamed; blockState:       DEFAULT; state:
INPROGR, xid/subid/cid: 116557/1/0, nestlvl: 1, children: <>
2005-07-25 20:30:26 DEBUG:  ProcessUtility
2005-07-25 20:30:26 DEBUG:  find_in_dynamic_libpath: trying "C:/Program
Files/PostgreSQL/8.0/lib/foo"
2005-07-25 20:30:26 DEBUG:  find_in_dynamic_libpath: trying "C:/Program
Files/PostgreSQL/8.0/lib/foo.dll"
2005-07-25 20:30:26 DEBUG:  CommitTransactionCommand
2005-07-25 20:30:26 DEBUG:  CommitTransaction
2005-07-25 20:30:26 DEBUG:  name: unnamed; blockState:       STARTED; state:
INPROGR, xid/subid/cid: 116557/1/2, nestlvl: 1, children: <>
2005-07-25 20:30:26 LOG:  could not send data to client: An operation was
attempted on something that is not a socket.
2005-07-25 20:30:26 LOG:  could not receive data from client: An operation
was attempted on something that is not a socket.
2005-07-25 20:30:26 LOG:  unexpected EOF on client connection
2005-07-25 20:30:26 DEBUG:  proc_exit(0)
2005-07-25 20:30:26 DEBUG:  shmem_exit(0)
2005-07-25 20:30:26 DEBUG:  exit(0)
2005-07-25 20:30:26 DEBUG:  reaping dead processes
2005-07-25 20:30:26 DEBUG:  waiting on 4 children
2005-07-25 20:30:26 DEBUG:  server process (PID 6092) exited with exit code
0
2005-07-25 20:30:26 DEBUG:  waiting on 3 children


Thanks & Regards,
Mehul



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group