Postgres - How-to Connection

About

A default howto postgres connection and howto service are provided after a fresh installation that is used in the howto's.

To use this connection, you need to start the service (ie a docker image)

Docker

Download and run the image

This connection is based on the Official Postgres Docker image.

  • You can download and start the image with the following command:

With tabul service start

tabul service start postgres
docker run \
    -e POSTGRES_PASSWORD=welcome \
    -p 5432:5432 \
    -d \
    --name postgres \
    postgres:13.21
docker run ^
    -e POSTGRES_PASSWORD=welcome ^
    -p 5432:5432 ^
    -d ^
    --name postgres ^
    postgres:13.21


  • Ping your connection to check that the database is up.
tabul connection ping postgres
The connection (postgres) has been pinged successfully

Start / Stop

You can then start and stop the image with the following command:

docker stop postgres
docker start postgres

Info

tabul connection info postgres
Information about the connection (postgres)
Attribute                    Value                                       Description
--------------------------   -----------------------------------------   --------------------------------------------------------------------
BOOLEAN_DATA_TYPE            Native                                      Boolean data type used to store boolean values
BUILDER_CACHE_ENABLED        true                                        Enable or disable the builder cache
CHAR_DEFAULT_PRECISION       1                                           Default CHAR precision
COMMENT                      The howto postgres connection               A connection description
DATABASE_MAJOR_VERSION                                                   The major version number of the database
DATABASE_MINOR_VERSION                                                   The minor version number of the database
DATABASE_PRODUCT_NAME                                                    The name of the database
DATABASE_PRODUCT_VERSION                                                 The version of the database
DATE_DATA_TYPE               NATIVE                                      Date data type used to store date values
DRIVER                       org.postgresql.Driver                       The jdbc driver class
DRIVER_NAME                                                              The driver name
DRIVER_VERSION                                                           The driver version
HOST                                                                     Host Server
JDBC_MAJOR_VERSION                                                       The major version number of JDBC
JDBC_MINOR_VERSION                                                       The minor version number of JDBC
LOGIN_STATEMENTS                                                         Statements that runs after a connection has been established
MAX_CONCURRENT_THREAD                                                    The maximum number of threads that can be created against the system
MAX_NAME_IN_PATH                                                         The maximum number of names in a path
NAME                         postgres                                    The name of the connection
NAME_QUOTING_DISABLED_CASE   UPPERCASE                                   The case to apply when quoting is disabled
NAME_QUOTING_ENABLED         true                                        Enable quoting of names
NATIVES                                                                  Native Driver attributes (jdbc properties, ...)
NCHAR_DEFAULT_PRECISION      1                                           Default NCHAR precision
NVARCHAR_DEFAULT_PRECISION   0                                           Default NVARCHAR precision
ORIGIN                       CONF                                        The origin of the connection
PASSWORD                     welcome                                     The user password
PORT                         5432                                        Host Port
SUPPORT_BATCH_UPDATES                                                    If the system supports batch SQL updates
SUPPORT_NAMED_PARAMETERS                                                 If the system supports named parameters in the SQL statement
TIMESTAMP_DATA_TYPE          NATIVE                                      Timestamp data type used to store timestamp values
TIME_DATA_TYPE               NATIVE                                      Time format data type to store time values
URI                          jdbc:postgresql://localhost:5432/postgres   The uri of the connection
USER                         postgres                                    The user name
VARCHAR_DEFAULT_PRECISION    0                                           Default VARCHAR precision
WORKING_PATH                 public.                                     The working path (Schema for database, directory for file system)

Support

Docker WSL2: Connection to localhost:5432 refused

If you get this message using Docker WSL2 on windows:

Connection to localhost:5432 refused
Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

You can try get the IP of the wsl machine

ip -br a

and use it in place of localhost. Example:

tabul connection upsert --uri "jdbc:postgresql://172.31.112.26:5432/postgres" postgres

Other user have reported that the following steps may help:

  • Settings another docker network space in Docker > Settings > Docker Engine configuration:
{
  "bip": "192.168.200.1/24",
}
  • restart your computer



Related Pages
HowTo - How to load XML files into a Postgres with Tabulify

This database howto will show you how to load Xml file and document into a database.
HowTo - How to load XML files into a database with Tabulify

This database howto will show you how to load Xml file and document into a database.
HowTo's Connections

Tabulify comes with pre-configured connections that are used in the How-to's After a fresh installation, you should see them by listing the connection. sqlite and sqlite-target are sqlite connection...
HowTo's Services

Tabulify comes with pre-configured services that are used in the How-to's After a fresh installation, you should see them by listing the service. where: oracle is an oracle database sqlserver...
PostgreSQL

Tabulify supports the Postgresql relational database TabulifyLearning Guide See: See We use the driver 42.2.16 that supports 8.2 or newer We support...
Postgres - Anonymous Code Block

In Postgres, an anonymous code block is executed via the non-standard SQL DO statement. The next steps will be using the postgres howto connection....
Postgres - Data Type Support

This page is the data type support in Postgres Below is the list of data type of the Postgres Howto connection printed with the connection type command. The reference can found on the Postgres...
Postgres - How to list SQL Tables

This howto will show you how to list SQL Tables
Postgres Connection

This page talks Postgres connection. You can: use the postgres howto connection to get quickly a Postgres database and a connection or create your own connection The section below shows you how...
Tabul - Connection Information

info is an action of the connection module that shows the connection attributes in a form fashion. list This command will show the information of the Sqlite HowTo Connection List only the database...

Task Runner