Skip to content

Commit

Permalink
Add license information to extension description
Browse files Browse the repository at this point in the history
Fixes #5436
  • Loading branch information
konskov committed Mar 17, 2023
1 parent 67ff84e commit b6356fb
Show file tree
Hide file tree
Showing 7 changed files with 635 additions and 63 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include(GitCommands)
include(GenerateScripts)
include(CMakeDependentOption)

option(APACHE_ONLY "only compile apache code" off)
# This requires all tests to run. This defaults to OFF but can be enabled to
# ensure that no tests are skipped because of missing tools.
option(REQUIRE_ALL_TESTS "Require all tests to run." OFF)
Expand Down Expand Up @@ -386,6 +387,12 @@ set(EXT_CONTROL_FILE ${PROJECT_NAME}.control)
if(${PG_VERSION_MAJOR} GREATER "12")
set(TRUSTED trusted=true)
endif()

if(APACHE_ONLY)
set(LICENSE_EDITION "Apache 2 Edition")
else()
set(LICENSE_EDITION "Community Edition")
endif()
configure_file(${EXT_CONTROL_FILE}.in ${EXT_CONTROL_FILE})

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXT_CONTROL_FILE}
Expand Down Expand Up @@ -618,8 +625,6 @@ add_subdirectory(sql)
add_subdirectory(test)
add_subdirectory(src)

option(APACHE_ONLY "only compile apache code" off)

if(NOT APACHE_ONLY)
add_subdirectory(tsl)
endif()
Expand Down
108 changes: 54 additions & 54 deletions test/expected/loader.out → test/expected/loader-oss.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- LICENSE-APACHE for a copy of the license.
\set TEST_DBNAME_2 :TEST_DBNAME _2
\c :TEST_DBNAME :ROLE_SUPERUSER
CREATE DATABASE :TEST_DBNAME_2;
CREATE DATABASE :"TEST_DBNAME_2";
DROP EXTENSION timescaledb;
--no extension
\dx
Expand Down Expand Up @@ -31,11 +31,11 @@ WARNING: mock post_analyze_hook "mock-1"

\dx
WARNING: mock post_analyze_hook "mock-1"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

CREATE EXTENSION IF NOT EXISTS timescaledb VERSION 'mock-1';
Expand Down Expand Up @@ -78,11 +78,11 @@ WARNING: mock post_analyze_hook "mock-1"

\dx
WARNING: mock post_analyze_hook "mock-1"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--start new backend;
Expand Down Expand Up @@ -113,11 +113,11 @@ WARNING: mock function call "mock-1"

\dx
WARNING: mock post_analyze_hook "mock-1"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
Expand Down Expand Up @@ -219,11 +219,11 @@ CREATE EXTENSION timescaledb VERSION 'mock-1';
WARNING: mock init "mock-1"
\dx
WARNING: mock post_analyze_hook "mock-1"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--start a new backend to update
Expand All @@ -239,11 +239,11 @@ WARNING: mock post_analyze_hook "mock-2"

\dx
WARNING: mock post_analyze_hook "mock-2"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--drop extension
Expand Down Expand Up @@ -274,11 +274,11 @@ WARNING: mock post_analyze_hook "mock-2"

\dx
WARNING: mock post_analyze_hook "mock-2"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

-- test db 1 still has old version
Expand All @@ -293,23 +293,23 @@ WARNING: mock post_analyze_hook "mock-1"

\dx
WARNING: mock post_analyze_hook "mock-1"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--try a broken upgrade
\c :TEST_DBNAME_2 :ROLE_SUPERUSER
\dx
WARNING: mock init "mock-2"
WARNING: mock post_analyze_hook "mock-2"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

\set ON_ERROR_STOP 0
Expand All @@ -326,11 +326,11 @@ WARNING: mock post_analyze_hook "mock-2"

\dx
WARNING: mock post_analyze_hook "mock-2"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--drop extension
Expand Down Expand Up @@ -362,11 +362,11 @@ WARNING: mock post_analyze_hook "mock-3"

\dx
WARNING: mock post_analyze_hook "mock-3"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-3 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-3 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

DROP EXTENSION timescaledb;
Expand Down Expand Up @@ -476,11 +476,11 @@ server closed the connection unexpectedly
connection to server was lost
\dx
WARNING: mock post_analyze_hook "mock-6"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-6 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-6 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--TEST: create extension when old .so already loaded
Expand All @@ -489,11 +489,11 @@ WARNING: mock post_analyze_hook "mock-6"
\dx
WARNING: mock init "mock-1"
WARNING: mock post_analyze_hook "mock-1"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-1 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

DROP EXTENSION timescaledb;
Expand Down Expand Up @@ -522,11 +522,11 @@ CREATE EXTENSION timescaledb VERSION 'mock-2';
WARNING: mock init "mock-2"
\dx
WARNING: mock post_analyze_hook "mock-2"
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+--------------------------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data
timescaledb | mock-2 | public | Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)
(2 rows)

--make sure parallel workers started after a 'DISCARD ALL' work
Expand All @@ -550,6 +550,6 @@ WARNING: mock init "mock-2"

-- clean up additional database
\c :TEST_DBNAME :ROLE_SUPERUSER
DROP DATABASE :TEST_DBNAME_2;
DROP DATABASE :"TEST_DBNAME_2";
WARNING: mock init "mock-2"
WARNING: mock post_analyze_hook "mock-2"

0 comments on commit b6356fb

Please sign in to comment.