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

quick server c question

From: Laurette Cisneros <laurette(at)nextbus(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: quick server c question
Date: 2001-08-20 22:57:18
Message-ID: Pine.LNX.4.33.0108201553170.26805-100000@visor.corp.nextbus.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-sql
Hi all,

My c is rusty and you are all pros!...so...

I want to write a server routine that will return a string so that when "SELECT retstr() from tbl;" is executed this string is returned.

What's the best way to do this?

i.e.

create:

CREATE FUNCTION retstr() RETURNS char???
  AS '/tmp/tst.so' LANGUAGE 'c';

c code:

#include postgres.h
char *  ????
 retstr()
{
    do something
    return string;
}

Thanks for the help,

-- 
Laurette


pgsql-admin by date

Next:From: Lamar OwenDate: 2001-08-21 00:21:08
Subject: Re: Re: upgrading RPM query
Previous:From: Chris CameronDate: 2001-08-20 19:10:28
Subject: Multiple Servers

pgsql-sql by date

Next:From: Josh BerkusDate: 2001-08-20 23:44:55
Subject: Re: Simple SQL-syntax
Previous:From: Josh BerkusDate: 2001-08-20 22:06:45
Subject: Re: Simple SQL-syntax

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group