is there example of update skript?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: is there example of update skript?
Date: 2011-12-07 13:26:22
Message-ID: CAFj8pRA4w9Uh17oBrPmAnr3pouxZKkqRd-ptXA6jak=3T92kOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

I am playing with extensions implemented in plpgsql. I am checking update.

I have a simple extension

file gdlib--1.1.sql
CREATE OR REPLACE FUNCTION gdlib_version()
RETURNS numeric AS $$
SELECT 1.1;
$$ LANGUAGE sql;

CREATE OR REPLACE FUNCTION hello(text)
RETURNS text AS $$
SELECT 'Hello, ' || $1 || ' from gdlib ' || gdlib_version();
$$ LANGUAGE sql;

file gdlib--1.0.sql
CREATE OR REPLACE FUNCTION gdlib_version()
RETURNS numeric AS $$
SELECT 1.0;
$$ LANGUAGE sql;

CREATE OR REPLACE FUNCTION hello(text)
RETURNS text AS $$
SELECT 'Hello, ' || $1 || ' from gdlib ' || gdlib_version();
$$ LANGUAGE sql;

I created a empty update files (it's probably wrong)

postgres=# SELECT * FROM pg_extension_update_paths('gdlib');
source | target | path
--------+--------+----------
1.0 | 1.1 | 1.0--1.1
1.1 | 1.0 | 1.1--1.0
(2 rows)

Issue

After ALTER EXTENSION gdlib UPDATE TO '1.1'

I have 1.0 function still?

I expected a refresh 1.1 sql script, but it was newer loaded

What are correct steps?

Regards

Pavel Stehule

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2011-12-07 13:30:22 Re: [pgadmin-support] Help for Migration
Previous Message Craig Ringer 2011-12-07 13:23:21 Re: [pgadmin-support] Help for Migration