HI,
El viernes, 2 de julio de 2010 10:26:43 UTC-3, (desconocido) escribió:
Hello,
I#39;ve got a problem with Functions in C using SPI.
Using: PostgreSQL 8.3, Codeblocks, Windows Server 2003 R2
I compiled the file quot;pgExampleSPI.cquot; with the following code
without any error:
Hi everyone,
Is is possible to add handlers so that a C function is fired when a transaction
is committed or rolled back, for example (pseudo code):
BEGIN;
CALL my_function(1);
CALL my_function(2);
CALL my_function(3);
ROLLACK;
my_function()
Create my_file.txt.tmp
Write some information to
Hi people,
after a two days break:
I could compile the following code with Visual C++ Express 2010 under Windows
Server 2003 R2:
/* Use 32-bit timer (provided header file uses 64-bit timer, not
* compatible with Windows postgreSQL versions */
#define _USE_32BIT_TIME_T
#define BUILDING_DLL 1
On Mon, Jul 05, 2010 at 10:20:30AM +0200, saitenhe...@web.de wrote:
Datum count_person(PG_FUNCTION_ARGS) {
SPI_connect();
int ret = SPI_exec(SELECT count(*) FROM person, 0);
SPI_finish();
PG_RETURN_INT32(ret);
}
But I guess I still did something wrong, because no matter how many
rows
On Sat, Jul 03, 2010 at 09:35:56AM +0800, Craig Ringer wrote:
On 02/07/10 21:26, saitenhe...@web.de wrote:
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
Why the conditional compilation of PG_MODULE_MAGIC?
That's the recommendation, so the module compiles on all versions of
Postgres.
Hello,I've got a problem with Functions in C using SPI.Using: PostgreSQL 8.3, Codeblocks, Windows Server 2003 R2I compiled the file "pgExampleSPI.c" with the following code without any error:/* Use 32-bit timer (provided header file uses 64-bit timer, not* compatible with Windows postgreSQL
Hello,
I've got a problem with user defined functions in C using SPI.
Using: PostgreSQL 8.3.7, Codeblocks (GNU GCC Compiler), Windows Server 2003 R2
I compiled the file pgExampleSPI.c with the following code without any error:
/* Use 32-bit timer (provided header file uses 64-bit timer, not
*
saitenhe...@web.de writes:
I compiled the file pgExampleSPI.c with the following code without any
error:
/* Use 32-bit timer (provided header file uses 64-bit timer, not
* compatible with Windows postgreSQL versions */
#define _USE_32BIT_TIME_T
#include postgres.h
#include executor\spi.h
Thanks for reply Tom!
I've tried several version:
#define _USE_32BIT_TIME_T
#include postgres.h
#include fmgr.h
#include executor\spi.h
/*
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
*/
extern Datum count_person (PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(count_person);
__declspec(dllexport)
On 07/02/2010 08:13 AM, saitenhe...@web.de wrote:
Thanks for reply Tom!
I've tried several version:
#define _USE_32BIT_TIME_T
#include postgres.h
#include fmgr.h
#include executor\spi.h
/*
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
*/
but still the same error occurs.
You
Thanks, I've already tried that. I doesn't make any difference. Still the same
error.
in Visual C++ I can't even compile it, although I set all links and compiler
directories like it was told in this post:
http://www.postgresql.org/docs/8.2/interactive/xfunc-c.html
I don't have more ideas.
On 07/02/2010 08:36 AM, saitenhe...@web.de wrote:
Thanks, I've already tried that. I doesn't make any difference. Still the
same error.
in Visual C++ I can't even compile it, although I set all links and
compiler directories like it was told in this post:
I'll try b) and hope I can find a solution.
Thanks for your support Joe.
Kind Regards, Max.
On 07/02/2010 08:36 AM, saitenhe...@web.de wrote:
Thanks, I've already tried that. I doesn't make any difference. Still the
same error.
in Visual C++ I can't even compile it, although I set all
On 02/07/10 21:26, saitenhe...@web.de wrote:
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
Why the conditional compilation of PG_MODULE_MAGIC?
ERROR: incompatible library G:/PostgreSQL/8.3/lib/pgExampleSPI.dll:
missing magic block
TIP: Extension libraries are required to use the
2010/4/15 Krzysztof Szewczyk k.szewc...@i-bs.pl
Hello All,
I wrote c function for postgresql, i compiled it as a shared file, next
I added my function to pgadmin everything was ok, but now when i wanna
call it the pgadmin is closing with no report.
Regards
--
Sent via pgsql-general
Hello All,
I wrote c function for postgresql, i compiled it as a shared file, next
I added my function to pgadmin everything was ok, but now when i wanna
call it the pgadmin is closing with no report.
Regards
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes
hm. I wonder if this is confusion between value/reference datums. Can
you do a quick check to see exactly where it's crashing (either before
you get into the function, at the getarg, or in the return)?
you can elog(WARNING, msg) to print out debug info from inside the
function.
merlin
It's
Hi there
Need help, I just took the example from Postgres help, code:
#include postgres.h
#include fmgr.h
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
PG_FUNCTION_INFO_V1(add_one);
__declspec (dllexport) Datum add_one(PG_FUNCTION_ARGS)
{
int32 arg = PG_GETARG_INT32(0);
On Wed, Dec 9, 2009 at 8:33 AM, AlexeyChe alexey.chernus...@gmail.com wrote:
Hi there
Need help, I just took the example from Postgres help, code:
#include postgres.h
#include fmgr.h
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
PG_FUNCTION_INFO_V1(add_one);
__declspec (dllexport)
Islam Hegazy wrote:
Hi all
I have postgresql server installed on a windows machine and I want to
retrieve data using C functions. I followed the steps in the
documentation but it didn't work for windows. I created a .dll
projects for my functions but postgres.h calls .h files that I can't
Andrei-
*If you're developing under nix* then I would use windows cygwin (bash
shell) e.g.
\cygwin\cygwin.bat
cd /
find . -name strings.h
you will see /usr/include
but this version of strings.h only includes string.h
to bring into environment make sure you include the /usr/include in .profile
- Original Message -
From: Andrei Kovalevski [EMAIL PROTECTED]
To: pgsql-general@postgresql.org; Islam Hegazy [EMAIL PROTECTED]
Sent: Thursday, May 03, 2007 7:32 AM
Subject: Re: [GENERAL] C functions under windows
Islam Hegazy wrote:
Hi all
I have postgresql server installed on a windows
Islam Hegazy wrote:
I have added the path to the include directory of postgresql but it
hasn't already some of the files that are in linux include path like
strings.h. It doesn't object about postgres.h which it can find now
but it objects about strings.h
I use MSVC6 to make my dll file.
Hi all
I have postgresql server installed on a windows machine and I want to retrieve
data using C functions. I followed the steps in the documentation but it didn't
work for windows. I created a .dll projects for my functions but postgres.h
calls .h files that I can't find on the windows
Are you building with the same compiler as the backend was built with? If
you're using the binary distribution that means mingw unless you're testing the
pre-beta snapshot Dave uploaded a few days ago.
/Magnus
--- Original message ---
From: Islam Hegazy [EMAIL PROTECTED]
Sent:
A Palmblad wrote:
I'm writing a function in C, and am trying to return a row,
containing Numeric and array types. I'm building the row with
heap_formtuple. I'm having trouble creating the numeric and array
Datums. If anyone has some example code illustrating this, that'd be
great.
See PL/R for
On Mon, May 03, 2004 at 12:48:19PM -0700, A Palmblad wrote:
I'm writing a function in C, and am trying to return a row, containing
Numeric and array types. I'm building the row with heap_formtuple.
I'm having trouble creating the numeric and array Datums. If anyone
has some example
Hi guys!
I need to migrate some plpgsql functions I have to C language.
These functions execute queries and process the results inside, and some of them return records... I've been reading the documentation, but I would like any of you to tell me where can I find some examples of these kind
Franco Bruno Borghesi writes:
I need to migrate some plpgsql functions I have to C language.
These functions execute queries and process the results inside, and some
of them return records... I've been reading the documentation, but I
would like any of you to tell me where can I find some
Hello !
I have to develop c++ function for PostgreSQL 7.3.1 under Windows 2000,
what compilers and linkers may be used for this purposes ? I have Visual
C++ 6.0 and C++Builder 5.0 . May I use them ?
Best regards,
Sincerely yours,
Yuriy Rusinov.
---(end of
Hello All,
I am writing my first C function for postgres and failing miserably. my C
function needs to get passed a username (char) , uid(int), and gid(int) and
what it does with those is builds a command string for an external app that
is called with system() and exits 0. I know this is
* Joel Dudley [EMAIL PROTECTED] [010327 11:29] wrote:
Hello All,
I am writing my first C function for postgres and failing miserably. my C
function needs to get passed a username (char) , uid(int), and gid(int) and
right, wrong and wrong.
char *, uid_t, gid_t.
--
-Alfred Perlstein -
Joel Dudley writes:
PG_FUNCTION_INFO_V1(ssh_exec);
Datum
ssh_exec(PG_FUNCTION_ARGS)
{
char sshcmd[255];
strncpy(sshcmd, "/usr/local/bin/plsshexec ", 255);
strncat(sshcmd, *uname, 255);
strncat(sshcmd, " ", 255);
strncat(sshcmd, *uid, 255);
Joel Dudley [EMAIL PROTECTED] writes:
what it does with those is builds a command string for an external app that
is called with system() and exits 0. I know this is strange and ugly but I
need to trigger this external app when an insert is made into a user table.
This seems an extremely
34 matches
Mail list logo