File: errors.sql

package info (click to toggle)
pgextwlist 1.19-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 216 kB
  • sloc: ansic: 849; sql: 62; makefile: 40; sh: 6
file content (27 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SELECT case
  when setting::int >= 130000 then 'PG 13+'
  when setting::int >= 100000 then 'PG 10..12'
  end as "regression output for PG version"
FROM pg_settings where name = 'server_version_num';

SET ROLE mere_mortal;

SELECT extname FROM pg_extension ORDER BY 1;

-- pre-existing extension
CREATE EXTENSION plpgsql;
COMMENT ON EXTENSION hstore IS 'plpgsql comment';
SELECT extname FROM pg_extension ORDER BY 1;

-- non-whitelisted extension
CREATE EXTENSION hstore;
COMMENT ON EXTENSION hstore IS 'hstore comment';
SELECT extname FROM pg_extension ORDER BY 1;

-- whitelisted extension, but dependency is missing
CREATE EXTENSION earthdistance;
SELECT extname FROM pg_extension ORDER BY 1;

-- drop non-whitelisted extension
DROP EXTENSION plpgsql;
SELECT extname FROM pg_extension ORDER BY 1;