2012-06-29 17:56:38 +12:00
# PostgreSQL Module Module
2022-07-15 12:23:59 +12:00
[![CI ](https://github.com/silverstripe/silverstripe-postgresql/actions/workflows/ci.yml/badge.svg )](https://github.com/silverstripe/silverstripe-postgresql/actions/workflows/ci.yml)
2022-08-02 17:55:18 +12:00
[![Silverstripe supported module ](https://img.shields.io/badge/silverstripe-supported-0071C4.svg )](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
2014-02-18 17:52:03 +13:00
2012-06-29 17:56:38 +12:00
## Requirements
2022-08-02 17:55:18 +12:00
* Silverstripe 4.0
2019-09-03 15:41:23 +12:00
* PostgreSQL >=9.2
* Note: PostgreSQL 10 has not been tested
2012-06-29 17:56:38 +12:00
2012-07-04 14:18:29 +12:00
## Installation
2012-06-29 17:56:38 +12:00
2019-09-03 15:41:23 +12:00
```
composer require silverstripe/postgresql
```
## Configuration
### Environment file
Add the following settings to your `.env` file:
```
SS_DATABASE_CLASS=PostgreSQLDatabase
SS_DATABASE_USERNAME=
SS_DATABASE_PASSWORD=
```
See [environment variables ](https://docs.silverstripe.org/en/4/getting_started/environment_management ) for more details. Note that a database will automatically be created via `dev/build` .
### Through the installer
Open the installer by browsing to install.php, e.g. http://localhost/install.php
Select PostgreSQL in the database list and enter your database details
2012-06-29 17:56:38 +12:00
## Usage Overview
2019-09-03 15:41:23 +12:00
See [docs/en ](docs/en/README.md ) for more information about configuring the module.
2012-06-29 17:56:38 +12:00
## Known issues
All column and table names must be double-quoted. PostgreSQL automatically
lower-cases columns, and your queries will fail if you don't.
2019-09-03 15:22:14 +12:00
Collations have known issues when installed on Alpine, MacOS X and BSD derivatives
2019-11-27 17:33:06 -08:00
(see [PostgreSQL FAQ ](https://wiki.postgresql.org/wiki/FAQ#Why_do_my_strings_sort_incorrectly.3F )).
We do not support such installations, although they still may work correctly for you.
2019-09-03 15:22:14 +12:00
As a workaround for PostgreSQL 10+ you could manually switch to ICU collations (e.g. und-x-icu).
There are no known workarounds for PostgreSQL < 10.
2012-06-29 17:56:38 +12:00
Ts_vector columns are not automatically detected by the built-in search
filters. That means if you're doing a search through the CMS on a ModelAdmin
object, it will use LIKE queries which are very slow. If you're writing your
own front-end search system, you can specify the columns to use for search
purposes, and you get the full benefits of T-Search.
If you are using unsupported modules, there may be instances of MySQL-specific
2015-11-03 08:45:29 +13:00
SQL queries which will need to be made database-agnostic where possible.