how to install extension pg_trgm (trigram) on postgresql

1,131 views
Skip to first unread message

Murilo Duarte

unread,
Mar 13, 2017, 12:14:26 PM3/13/17
to Google Cloud SQL discuss
Olá, eu preciso saber se há alguma maneira de adicionar uma extensão trigrama não PostgreSQL, obtido a partir de Google Cloud SQL! Faça o seguinte comentário:

"PG :: UndefinedFile: Erro: Não foi possível arquivo de controle de extensão aberta" /share/extension/pg_trgm.control ": Nenhum arquivo ou diretório
: Cria a pg_trgm extensão;
"

David Newgas

unread,
Mar 13, 2017, 12:26:14 PM3/13/17
to Google Cloud SQL discuss
That is not currently a supported extension. Thank you for the feedback though, we are collecting customer use cases to understand what features are desired for GA.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a7b3f669-adfe-4c76-aee4-4a5462aa2ea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Preston Marshall

unread,
Mar 13, 2017, 12:42:10 PM3/13/17
to Google Cloud SQL discuss
Just to pile on, we'd also need this extension to move over. Extension support is seriously limited with Cloud SQL Postgresql, I hope y'all are planning on adding a lot more, as there are some very basic and common ones missing.

Mark van der Velden

unread,
Mar 20, 2017, 9:19:34 AM3/20/17
to Google Cloud SQL discuss
Hi,

The Trigram extension is a requirement for us as well, it's needed to enable the gin_trgm_ops index which significantly speeds up some of our queries:

# explain select id, name from some_table where name ~ 'foo';
                           QUERY PLAN
-----------------------------------------------------------------
 
Seq Scan on some_table  (cost=0.00..1829.67 rows=337 width=22)
   
Filter: ((name)::text ~ 'foo'::text)
(2 rows)


# create extension pg_trgm;  
# create index name_trgm_idx on some_table using gin (name gin_trgm_ops);


# explain select id, name from some_table where name ~ 'foo';
                                  QUERY PLAN
-------------------------------------------------------------------------------
 
Bitmap Heap Scan on some_table  (cost=14.62..842.99 rows=337 width=22)
   
Recheck Cond: ((name)::text ~ 'foo'::text)
   
->  Bitmap Index Scan on name_trgm_idx  (cost=0.00..14.53 rows=337 width=0)
         
Index Cond: ((name)::text ~ 'foo'::text)
(4 rows)

Rolo Mawlabaux

unread,
Mar 27, 2017, 3:58:19 PM3/27/17
to Google Cloud SQL discuss
Hi there.

I'd like to add a +1 to the request for the pg_trgm extension. This is a requirement for Django's full text search capabilities: https://docs.djangoproject.com/en/1.10/ref/contrib/postgres/search/

Thanks.

Rolo.
Reply all
Reply to author
Forward
0 new messages