Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install the cube function for Postgresql

Tags:

postgresql

when I just run the sample statements like below:

select cube_union('(0,5,2),(2,3,1)', '0')

but facing the error:

postgres=# select cube_union('(0,5,2),(2,3,1)', '0');
ERROR:  function cube_union(unknown, unknown) does not exist
LINE 1: select cube_union('(0,5,2),(2,3,1)', '0');
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
postgres=# 

Can anyone help me? Is there any place I need to setup or need to install the function separately.

like image 417
Qiang Wang Avatar asked Jul 11 '18 07:07

Qiang Wang


1 Answers

The cube_union() function is provided by the extension cube

To install an extension you need create extension

An extension is installed per database, so you need to connect to the database you are using as a super user, then run:

create extension cube;
like image 163
a_horse_with_no_name Avatar answered Oct 07 '22 12:10

a_horse_with_no_name