There is an indirect way to obtain this information, but only if you are using the GIN index on a tsvector column.
Table structure
CREATE TABLE bench(
id bigserial,
f1 text,
f2 text,
f3 text,
f4 text
);
Populate table bench with some data.
Add the tsvector column and update it:
ALTER TABLE bench
ADD COLUMN ts tsvector;
UPDATE bench
SET ts =
strip(to_tsvector('simple',coalesce(f1,''))
||to_tsvector('simple',coalesce(f2,''))
||to_tsvector('simple',coalesce(f3,''))
||to_tsvector('simple',coalesce(f4,''))
)
;
Create the GIN index
CREATE INDEX ooz_gin ON bench USING GIN (ts) WITH (fastupdate=on);
List all known words in the ts column (and thus in the index) and their trigrams:
SELECT word,show_trgm(word) as trigrams
FROM ts_stat('SELECT ts FROM bench');
Result (with my test data):
word | trigrams
---------------------+-----------------------------------------------------------------------------------------
zworykin | {" z"," zw","in ",kin,ory,ryk,wor,yki,zwo}
zulu | {" z"," zu","lu ",ulu,zul}
zorch | {" z"," zo","ch ",orc,rch,zor}
zoning | {" z"," zo",ing,"ng ",nin,oni,zon}
zips | {" z"," zi",ips,"ps ",zip}
zipping | {" z"," zi",ing,ipp,"ng ",pin,ppi,zip}
zippered | {" z"," zi","ed ",ere,ipp,per,ppe,red,zip}
ziploc | {" z"," zi",ipl,loc,"oc ",plo,zip}
zion | {" z"," zi",ion,"on ",zio}