/[pgestraier]/trunk/pgest.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/pgest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by dpavlin, Fri May 20 12:19:05 2005 UTC revision 2 by dpavlin, Fri May 20 13:00:46 2005 UTC
# Line 98  Datum pgest(PG_FUNCTION_ARGS) { Line 98  Datum pgest(PG_FUNCTION_ARGS) {
98                  if ( 0 == funcctx->max_calls )                  if ( 0 == funcctx->max_calls )
99                          elog(INFO, "pgest: no results for: %s", query );                          elog(INFO, "pgest: no results for: %s", query );
100    
101                  elog(INFO, "pgest: found %d hits for %s", funcctx->max_calls, query);                  elog(DEBUG1, "pgest: found %d hits for %s", funcctx->max_calls, query);
102    
103                  /* Build a tuple description for a __pgest tuple */                  /* Build a tuple description for a __pgest tuple */
104                  tupdesc = RelationNameGetTupleDesc("__pgest");                  tupdesc = RelationNameGetTupleDesc("__pgest");
# Line 118  Datum pgest(PG_FUNCTION_ARGS) { Line 118  Datum pgest(PG_FUNCTION_ARGS) {
118    
119                  MemoryContextSwitchTo(oldcontext);                  MemoryContextSwitchTo(oldcontext);
120    
121                  elog(INFO, "SRF_IS_FIRSTCALL done");                  elog(DEBUG1, "SRF_IS_FIRSTCALL done");
122          }          }
123    
124          /* stuff done on every call of the function */          /* stuff done on every call of the function */
# Line 134  Datum pgest(PG_FUNCTION_ARGS) { Line 134  Datum pgest(PG_FUNCTION_ARGS) {
134                  HeapTuple       tuple;                  HeapTuple       tuple;
135                  Datum           result;                  Datum           result;
136    
137                  elog(INFO, "pgest: loop count %d", call_cntr);                  elog(DEBUG1, "pgest: loop count %d", call_cntr);
138    
139                  if (! est_result) {                  if (! est_result) {
140                          elog(ERROR, "pgest: no estraier results");                          elog(ERROR, "pgest: no estraier results");
# Line 149  Datum pgest(PG_FUNCTION_ARGS) { Line 149  Datum pgest(PG_FUNCTION_ARGS) {
149    
150                  if (doc = est_db_get_doc(db, est_result[call_cntr], 0)) {                  if (doc = est_db_get_doc(db, est_result[call_cntr], 0)) {
151                                    
152                          elog(INFO, "URI: %s\n Title: %s\n",                          elog(DEBUG1, "URI: %s\n Title: %s\n",
153                                  est_doc_attr(doc, "@uri"),                                  est_doc_attr(doc, "@uri"),
154                                  est_doc_attr(doc, "@title")                                  est_doc_attr(doc, "@title")
155                          );                          );
# Line 197  Datum pgest(PG_FUNCTION_ARGS) { Line 197  Datum pgest(PG_FUNCTION_ARGS) {
197                    
198                  SRF_RETURN_NEXT(funcctx, result);                  SRF_RETURN_NEXT(funcctx, result);
199          } else {          } else {
200                  elog(INFO, "loop over");                  elog(DEBUG1, "loop over");
201    
202                  if(!est_db_close(db, &ecode)){                  if(!est_db_close(db, &ecode)){
203                          elog(INFO, "est_db_close error: %s", est_err_msg(ecode));                          elog(INFO, "est_db_close error: %s", est_err_msg(ecode));
# Line 293  char *attr2text(ESTDOC *doc, char *attr) Line 293  char *attr2text(ESTDOC *doc, char *attr)
293          const char *attrval;          const char *attrval;
294          int len;          int len;
295    
296          elog(INFO, "doc: %08x, attr: %s", doc, attr);          elog(DEBUG1, "doc: %08x, attr: %s", doc, attr);
297    
298          if (attrval = est_doc_attr(doc, attr)) {          if (attrval = est_doc_attr(doc, attr)) {
299                  val = (char *) palloc(strlen(attrval) * sizeof(char));                  val = (char *) palloc(strlen(attrval) * sizeof(char));
# Line 302  char *attr2text(ESTDOC *doc, char *attr) Line 302  char *attr2text(ESTDOC *doc, char *attr)
302          }          }
303    
304          len = strlen(attrval);          len = strlen(attrval);
305          elog(INFO, "attr2text(%s) = '%s' %d bytes", attr, attrval, len);          elog(DEBUG1, "attr2text(%s) = '%s' %d bytes", attr, attrval, len);
306    
307          len++;          len++;
308          len *= sizeof(char);          len *= sizeof(char);

Legend:
Removed from v.1  
changed lines
  Added in v.2

  ViewVC Help
Powered by ViewVC 1.1.26