Parent Directory | Revision Log
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 |