HuasoFoundries/phpPgAdmin6

Creating database fails, and tries on wrong server if logged into multiple

joachimtingvold opened this issue · 3 comments

PostgreSQL 9.6.15
phpPgAdmin6 on latest master-branch (16b6650)
nginx/1.18.0
php7.3 (7.3.19-1~deb10u1)

Trying to create a database fails with the following error;

strsqlerror
ERROR: zero-length delimited identifier at or near """"

LINE 1: ...t1" WITH TEMPLATE="template1" ENCODING='UTF-8' TABLESPACE ""

^

SQL:
CREATE DATABASE "kek-test1" WITH TEMPLATE="template1" ENCODING='UTF-8' TABLESPACE ""

image

Additionally, if you are connected to multiple servers, it will attempt to create the database on the server you logged into first.

  1. Log into server1
  2. Log into server2
  3. Try to create database on server2
  4. The creation fails, but shows that it tried to create it on server1

image
image

Not the best comparison, but this works fine using phpPgAdmin v6.0.0-b28 on PostgreSQL 9.6.10.

I see... this one has the same origin 2b72a65
having the collation , encoding and namespace not set, it shouldn't be using those parameters, but it was comparing empty strings with nulls, therefore there wasn't strict equality .

I'm releasing the fix as v.6.1.2