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

Question regarding PGresult *

From: "Agape" <agape(at)korea(dot)co(dot)kr>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Question regarding PGresult *
Date: 1998-10-12 00:39:31
Message-ID: 001601bdf578$c8e3e0e0$14d1a1d1@eloha (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

I'm sorry for posting this to [Hackers] group but I cound't find an expert
in [General] group who can help me. So to speak.

I have a question regarding programming in C/C++ and postgreSQL.
I'm a C/C++ programmer but not an expert.

My question is:
Is there any way that I can save couple of results to one PGresult * ??

This is precisely what I'm going to do..
I'm developing search engine.
Let's assume.  If user enter for keywords like "Search Engine"
My program will separate each tokens.. and postgres will search like as

Something Like this
DECLARE portal1 CURSOR FOR select * from db where description ~* '^search
DECLARE portal2 CURSOR FOR select * from db where description ~* 'search
DECLARE portal3 CURSOR FOR select * from db where description ~* = 'search'
and description ~* 'engine';
DECLARE portal4 CURSOR FOR select * from db where description ~* = 'search'
or description ~* 'engine';

res = PQexec(conn,"FETCH ALL in portal*");  // Like this
portal1 sould go first, portal4 should go last.
And I don't wanna use any insert/copy command
(Don't wanna make any new temporary table. becasue there will be lots of

I really need this function.

If anyone has any idea please let me know..

Thanks in advence.
//     All you need to know about KOREA
// SeeHyun Lee <agape(at)korea(dot)co(dot)kr>         ICQ# 3413400

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-10-12 01:04:17
Subject: Re: [HACKERS] Minor problem with Solaris 2.7beta
Previous:From: Billy G. AllieDate: 1998-10-11 23:32:25
Subject: PostgreSQL 6.4 patches - portability related.

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