Postgres Configuration with 3.3.0b1

Discussion in 'Installation/Configuration' started by kopite, Apr 1, 2025.

  1. kopite

    kopite New Member

    Hi,

    I've just updated to 3.3.0b1 and wanted to try out the postgresql db support.

    I cant seem to find any documentation on what I need to do to configure it.

    I've clicked the PostgreSQL Database button in System Config But not sure what else is needed?

    When I try and create a psql db from the console It seems to create a mysql db instead.

    Am I missing something?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) You must install PostgreSQL, version 14 or newer.
    2) Then you must update ISPConfig to 3.3. beta 1.
    3) Install PHP PostgreSQL extension. Take care to install it for the system php version, e.g. php8.2-pgsql and not the package php-pgsql
    4) Finally, you must enable PostgreSQL under System > Interface > main config.

    -- Updated 2025-04-18 --
     
    Last edited: Apr 28, 2025
  3. atmomin2003

    atmomin2003 New Member

    Above worked well to enable postgresql.
    I have existing postgresql and databases created on it, is there a way to link it with existing websites? this will help for future tracking as well.
    Thanks a lot.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There is currently no way to link existing databases. All you could try to do is to manually add them in the ISPConfig database and database user tables.
     
  5. kopite

    kopite New Member

    I have done this and clicked to create a db.

    It seems to have done it front end but when I log into PSQL The database doesn't show :/

    No users or databases seem to have been created although they are showing in the admin

    I'm using psql 17.4 and ubuntu 24.04.2
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure that you have PostgreSQL support in PHP installed. Otherwise, it can not work.
     
  7. kopite

    kopite New Member

    Hey till,

    I've installed this : sudo apt-get install php-pgsql

    and then done an update again but databases still don't seem to be getting created
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Which Linux distributions do you use? E.g. for Debian 12, the package is php8.2-pgsql. If I remember correctly, for some reason php-pgsql did not work for me some time ago, so it's better to try to install the package for the system's PHP version with a correct version number.

    Besides that, you can use debug mode to see why the database can not be created:

    https://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/
     
  9. kopite

    kopite New Member

    I'm running Ubuntu 24.04.02 lts

    Looks like that might have been the issue.

    Installed php8.3-pgsql Instead of php-pgsql And all seems to be working now :D

    Thanks!!!!
     
    till likes this.
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    hmm. is there a problem with assigning database quotas and postgres?

    i've had a test system (ubuntu 24.04 ispconfig 3.2.12.p1) which i've just install postgresql on
    (apt install postgresql using ubuntu repo which installed postgresql-16)
    installed php8.2-pgsql, php8.3-pgsql and pg8.4-sql (only 8.2, 8.3 and 8.4 versions of php install on server)
    and run ispconfig_update.sh to update to 3.3.0.p1

    everything ok to this point.

    i thought i had problems with postgres db's not getting created, but i think the mysq/pgsql dropdown reset to mysql
    tried it again, as admin, creating a postgres db for a client account, and that's fine,

    sudo -u postgres psql connects, and \du lists the client db user, and \l lists the clients db..

    Code:
    postgres=# \du
                                  List of roles
     Role name  |                         Attributes                   
    ------------+------------------------------------------------------------
     c2postgres |
     ispconfig  | Superuser, Create role, Create DB
     postgres   | Superuser, Create role, Create DB, Replication, Bypass RLS
    
    postgres=# \l
                                                              List of databases
       Name    |   Owner    | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |     Access privileges
    -----------+------------+----------+-----------------+-------------+-------------+------------+-----------+---------------------------
     c2pstest  | c2postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =Tc/c2postgres           +
               |            |          |                 |             |             |            |           | c2postgres=CTc/c2postgres
     postgres  | postgres   | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           |
     template0 | postgres   | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres              +
               |            |          |                 |             |             |            |           | postgres=CTc/postgres
     template1 | postgres   | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres              +
               |            |          |                 |             |             |            |           | postgres=CTc/postgres
    (4 rows)
    
    
    the client db limits are ok, set to unlimited number of dbs, and total 10Gb of disk quota (image1)
    but if i try to create a postgres database whilst logged in as a client, the whole line for setting the max db size disappears, and when clicking on save, i get an error message about max available db quota, (image2)

    the db size limit option also disappears when switching the option from mysql to postgresql when creating the clients db as admin, (images 3 and 4), but it does successfully create the database.
     

    Attached Files:

    Last edited: May 14, 2025
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure that you allow a certain number of PostgreSQL databases in client limits, there is a new input field for that. Also, there is one little quirk with database limits at the moment, the MySQL limit is treated as an overall limit (MySQL + PostgreSQL databases). So e.g. if you want to allow a user 5 PostgreSQL databases, you must allow him to create at least 5 MySQL databases.
     
  12. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    client limits are set to -1 for both mysql and postgres - see image1 in my post..
    forgot to attach them when i posted, they're attached now.

    the problem doesn't appear to be with the number of db's. although having to allow a number of mysql db's to allow that many postgres db's is useful to know.

    it's the db max size option, it completely disappears for postgres and then complains about the disk quota limit.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Strange. DB max size is not available for Postgres, that's why it disappears so nobody can enter something there. I do not have that issue here on my systems, whether I use a client or admin account. I will have to look into the code to see under what conditions can happen and if I can reproduce that. Could you please post a screenshot from the limits tab of the affected client that shows all MySQL and PostgreSQL limits? So I can set it up exactly as on your server.
     
  14. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    image1.png
     
    till likes this.

Share This Page