|
drop type __pgest cascade; |
|
1 |
|
|
2 |
CREATE TYPE __pgest AS ( |
-- select * from pgest('/index/path', 'query', '@title ISTRINC foo', limit, offset, ARRAY['@id','@title','@size']) as (id text, title text, size text); |
|
-- id integer, |
|
|
id text, |
|
|
uri text, |
|
|
title text, |
|
|
-- size integer |
|
|
size text |
|
|
); |
|
|
|
|
|
-- Search est-e index as table |
|
|
-- select * from pgest('/index/path','query', '@uri ISTREW .txt', limit, offset); |
|
|
CREATE OR REPLACE FUNCTION pgest(text, text, text, int, int) |
|
|
RETURNS SETOF __pgest |
|
|
AS 'pgest', 'pgest' |
|
|
LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT; |
|
|
|
|
|
-- select * from pgest('/index/path', 'query', '@title ISTRINC foo', limit, offset, {'@id','@title','@size'}) as (id text, title text, size text); |
|
3 |
CREATE OR REPLACE FUNCTION pgest(text, text, text, int, int, text[]) |
CREATE OR REPLACE FUNCTION pgest(text, text, text, int, int, text[]) |
4 |
RETURNS setof record |
RETURNS setof record |
5 |
AS 'pgest','pgest_attr' |
AS 'pgest','pgest_attr' |
6 |
LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT; |
LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT; |
7 |
|
|