3

I'm trying to install a custom small extension for Postgres just for testing, but I can't do it.

My steps: 1.- Create the *.sql file (hola.sql):

CREATE OR REPLACE FUNCTION di_hola() 
RETURNS void AS 
$BODY$
BEGIN
RAISE NOTICE 'Hola';
END; 
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION di_hola()
  OWNER TO postgres;

2.- Create control file (hola.control):

# hola extension
comment = 'Funcion para decir hola'
default_version = '1.0'
relocatable = false

3.- Makefile:

EXTENSION = hola
DATA = hola.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

4.- Install it (in my case /usr/share/postgresql/10/extension)

sudo make USE_PGXS=1 install

5.- From psql (psql -U postgres -h localhost -W)

postgres=# create extension hola;
ERROR:  extension "hola" has no installation script nor update path for version "1.0"

I can't find many information about this error. The files are properly installed in /usr/share/postgresql/10/extension

I have Postgres 10 under Linux Mint.

Thank you

1 Answer 1

7

The SQL script for version 1.0 must be called

hola--1.0.sql
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.