Skip to main content

Get Started with Postgresql Extension Installer

Getting Started

  • Use our step-by-step guide to get started with Postgresql Extension Installer in minutes.

1. Download Python

  • Get started with Python to use everything in the Postgresql Extension Installer. We recommend using the 3.6 version.

  • Download Python

2. Get the command line tool

pip install postgresql-extension-installer

3. Download PostgreSQL

  • Get started with PostgreSQL to use everything in the Postgresql Extension Installer. We recommend using the latest version.

4. Enabling Contrib

-- Must be python3u
CREATE EXTENSION python3u;

5. Enabling PostgreSQL Extension Installer

CREATE OR REPLACE FUNCTION m_installer_setup()
    RETURNS TEXT
    LANGUAGE 'plpython3u'

    COST 100
    VOLATILE
AS $BODY$
    # -- ==========================================================
    # --    Installer

    # --    Copyright 2019 LEE DONG GUN(2019.12.28)
    # -- ==========================================================

    from postgresql_extension_installer import Installer

    installer = Installer(plpy)
    return "ok"
$BODY$;

Documentation

API Reference

.Query Format

  • It is similar to XML.
Info
-->Info<--
--<Name>--
    -- INSERT UNIQUE NAME HERE (e.q com.example.packagename)
--<Version>--
    -- INSERT VERSION HERE
--<Provider>--
    -- INSERT PROVIDER HERE
--<lib>--
    -- INSERT PYTHON LIBRARY HERE
  • Example

    -->Info<--
    --<Name>--
    me.faena.postgresql_extension_installer
    --<Version>--
    2019.12.22.1010
    --<Provider>--
    https://raw.githubusercontent.com/Sotaneum/PostgreSQL-Extension-Installer/master/tests/test.query
    https://raw.githubusercontent.com/Sotaneum/PostgreSQL-Extension-Installer/alpha/tests/test.query
    --<lib>--
    postgresql_deepgeo
    
Table
-->Table<--
--<TABLE_NAME>--
CREATE TABLE TABLE_NAME(
   -- INSERT HERE COLUMN
);
  • Example

    -->Table<--
    --<sql_list>--
    CREATE TABLE sql_list(
        sql json
    );
    
    • 2 or more

      -->Table<--
      --<sql_list>--
      CREATE TABLE sql_list(
          sql json
      );
      --<log_list>--
      CREATE TABLE log_list(
          log text
      );
      
Function
-->Function<--
--<FUNCTION_NAME>--
CREATE OR REPLACE FUNCTION FUNCTION_NAME()
    -- INSERT HERE FUNCTION
ALTER FUNCTION FUNCTION_NAME();
  • Example

    -->Function<--
    --<print_info>--
    CREATE OR REPLACE FUNCTION print_info()
        RETURNS TEXT
        LANGUAGE 'plpython3u'
    
        COST 100
        VOLATILE
    AS $BODY$
        # -- ==========================================================
        # --    Installer
    
        # --    Copyright 2019 LEE DONG GUN(2019.12.22)
        # -- ==========================================================
    
        return 'TEST'
    
    $BODY$;
    
    • 2 or more

      -->Function<--
      --<print_info>--
      CREATE OR REPLACE FUNCTION print_info()
          RETURNS TEXT
          LANGUAGE 'plpython3u'
      
          COST 100
          VOLATILE
      AS $BODY$
          # -- ==========================================================
          # --    Installer
      
          # --    Copyright 2019 LEE DONG GUN(2019.12.22)
          # -- ==========================================================
      
          return 'TEST'
      
      $BODY$;
      
      ALTER FUNCTION print_info();
      --<create_table>--
      CREATE OR REPLACE FUNCTION create_table(
          character varying
          )
          RETURNS text
          LANGUAGE 'plpgsql'
      
          COST 100
          VOLATILE STRICT 
      AS $BODY$
      DECLARE        
          f_table_name 	alias for $1;
      
          model_name_str	text;
      BEGIN
          sql := 'CREATE TABLE ' || f_table_name || '(log TEXT);';
          EXECUTE sql INTO model_name_str;
          RETURN
              quote_literal(model_name_str);
      END;
      $BODY$;
      
      ALTER FUNCTION create_table(character varying);
      
      COMMENT ON FUNCTION create_table(character varying)
          IS 'args: table_name';
      
Type
-->Type<--
--<TYPE_NAME>--
CREATE TYPE TYPE_NAME AS
(
    -- INSERT HERE COLUMN
);
  • Example

    -->Type<--
    --<point>--
    CREATE TYPE point AS
    (
        x int,
        y int
    );
    
    • 2 or more

      -->Type<--
      --<point>--
      CREATE TYPE point AS
      (
          x int,
          y int
      );
      --<mpoint>--
      CREATE TYPE mpoint AS
      (
          point point[]
      );
      
Other
  • Other SQL usage is possible if supported by PostgreSQL.

Support Functions

Install
  • Example

    SELECT m_installer_install()
    
Update
  • Will try to reinstall base on the installed information.

  • Example

    SELECT m_installer_update();
    
Uninsall
  • Will try to uninstall base on the installed information.

  • Example

    SELECT m_installer_uninstall();
    
Python Library Install(Update)
  • Will try to Install about Python Library based on the installed information.

  • Example

    SELECT m_installer_pylib_update();
    
Remove Cache
  • Try delete the space used for the installation.

  • Example

    SELECT m_installer_delete_cache();
    

Log

  • 2019.12.28.1256
    • create
      • loader
        • from db, file, default
      • pyhon_package
        • install python lib
      • query
      • util
  • 2019.12.22.1618
    • defualt format modify
    • Provider Bug fix
  • 2019.12.22.0216
    • Python library Install
      • Bug fix

Release files for postgresql-extension-installer 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for postgresql-extension-installer 0.0.3
File Interpreter ABI Platform
postgresql_extension_installer-0.0.3.0-py3-none-any.whl Python 3 none any Details

Release files / postgresql_extension_installer-0.0.3.0-py3-none-any.whl

Download URL postgresql_extension_installer-0.0.3.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
336cfb09fe0a2fcb503f166c839c06b048ad7174be11ba95cb9261bcab6fb165
BLAKE2b-256 checksum
How to use checksums
ee811eaa0902861d79c5450076394bad9babcbfa98d8ffe5321256a27b569cda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page