This repository has been archived on 2025-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/legacyworlds-server-data/db-structure/parts/020-extensions.sql
Emmanuel BENOîT e50775ec76 Database definition & tests organisation
* The main loader script has been updated to generate the list of files
it needs to load automatically. As a consequence, files that contained
manually-maintained lists of scripts have been removed, and definition
directories have been renamed accordingly.

* PostgreSQL extension loading and configuration has been moved to a
separate script to be loaded automatically in the main transaction.

* Data and function definition scripts that had the -data or -functions
suffix have been renamed (the suffix is unnecessary).

* Unit tests have been reorganised to follow the definition's structure.

* Documentation has been improved
2012-01-06 11:19:19 +01:00

23 lines
723 B
SQL

-- LegacyWorlds Beta 6
-- PostgreSQL database scripts
--
-- Load and configure required PostgreSQL extensions
--
-- Copyright(C) 2004-2012, DeepClone Development
-- --------------------------------------------------------
/* Register the dblink extension */
CREATE EXTENSION dblink;
/* Create foreign data wrapper and server used to write logs from within
* transanctions
*/
CREATE FOREIGN DATA WRAPPER pgsql
VALIDATOR postgresql_fdw_validator;
CREATE SERVER srv_logging
FOREIGN DATA WRAPPER pgsql
OPTIONS ( hostaddr '127.0.0.1' , dbname :dbname_string );
CREATE USER MAPPING FOR :dbuser
SERVER srv_logging
OPTIONS ( user :dbuser_string , password :dbupass );
GRANT USAGE ON FOREIGN SERVER srv_logging TO :dbuser;