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

Annotation of /trunk/pgest.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19 - (hide annotations)
Thu May 26 17:56:53 2005 UTC (18 years, 11 months ago) by dpavlin
File size: 707 byte(s)
Created new function which allows users to specify attributes which should
be returned like this:

select * from pgest('/index/path', 'query', '@title ISTRINC foo', limit, offset, {'@id','@title','@size'}) as (id text, title text, size text);

1 dpavlin 1 drop type __pgest cascade;
2    
3     CREATE TYPE __pgest AS (
4     -- id integer,
5     id text,
6     uri text,
7     title text,
8     -- size integer
9     size text
10     );
11    
12     -- Search est-e index as table
13 dpavlin 19 -- select * from pgest('/index/path','query', '@uri ISTREW .txt', limit, offset);
14 dpavlin 5 CREATE OR REPLACE FUNCTION pgest(text, text, text, int, int)
15 dpavlin 1 RETURNS SETOF __pgest
16     AS 'pgest', 'pgest'
17 dpavlin 19 LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT;
18 dpavlin 1
19 dpavlin 19 -- select * from pgest('/index/path', 'query', '@title ISTRINC foo', limit, offset, {'@id','@title','@size'}) as (id text, title text, size text);
20     CREATE OR REPLACE FUNCTION pgest(text, text, text, int, int, text[])
21     RETURNS setof record
22     AS 'pgest','pgest_attr'
23     LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT;

  ViewVC Help
Powered by ViewVC 1.1.26