Skip to content

Commit

Permalink
Add script to upgrade v0.90.0 to v0.91.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Sep 10, 2012
1 parent db836ac commit 5325007
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions sql/pgtap--0.90.0--0.91.0.sql
@@ -0,0 +1,27 @@
DO $$
BEGIN
IF pg_version_num() < 9.0 THEN
EXECUTE $E$
CREATE FUNCTION pg_tablespace_location(
OID
) RETURNS TEXT LANGUAGE SQL AS $F$
SELECT spclocation
FROM pg_catalog.pg_tablespace
WHERE OID = $1;
$F$;
$E$;
END IF;
END;
$$;

CREATE OR REPLACE FUNCTION has_tablespace( NAME, TEXT, TEXT )
RETURNS TEXT AS $$
SELECT ok(
EXISTS(
SELECT true
FROM pg_catalog.pg_tablespace
WHERE spcname = $1
AND pg_tablespace_location(oid) = $2
), $3
);
$$ LANGUAGE sql;

0 comments on commit 5325007

Please sign in to comment.