gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

Re-enable test with database name containing quotes.

Open hlinnaka opened this issue 6 years ago • 4 comments

Since the PostgreSQL 9.4.20 merge, commit 928bca1a30, pg_upgrade can handle database names that contain quotes correctly. Re-enable test for it.

Fixes https://github.com/greenplum-db/gpdb/issues/3857

hlinnaka avatar Jan 15 '19 11:01 hlinnaka

A db with similar name is also created in gpcopy.source: "funny copy""db'with\\quotes", but it doesn't mean we couldn't have another one ;)

LGTM, thank you.

remotefish avatar Jan 15 '19 13:01 remotefish

Looks like Concourse caught something:

subprocess.CalledProcessError: Command 'psql 'funny"db'"'"'with\\quotes' -t -c " CREATE EXTENSION IF NOT EXISTS gp_replica_check "' returned non-zero exit status 1

jchampio avatar Jan 15 '19 16:01 jchampio

On 15/01/2019 18:07, Jacob Champion wrote:

Looks like Concourse caught something:

subprocess.CalledProcessError: Command 'psql 'funny"db'"'"'with\\quotes' -t -c " CREATE EXTENSION IF NOT EXISTS gp_replica_check "' returned non-zero exit status 1

Yeah. I went down this rabbit hole to some depth.

The immediate issue is that there are shell-quoting issues in gp_replica_check.py. After fixing that, this was the next obstacle:

funny"db'with\quotes=# create extension "gp_replica_check" ; ERROR: no schema has been selected to create in

There's a per-database SET option in that database, setting search_path to a non-existent schema.

Ok, that seems easy enough to fix, there's a CREATE EXTENSION WITH SCHEMA option for that. But alas:

funny"db'with\quotes=# create extension "gp_replica_check" with schema public; ERROR: current transaction is aborted, commands ignored until end of transaction block (seg0 127.0.0.1:40000 pid=12190)

Turns out, the WITH SCHEMA option doesn't work correctly in GPDB :-(. That's a separate issue from quoting the database name.

  • Heikki

hlinnaka avatar Jan 15 '19 16:01 hlinnaka

Should we keep this PR as we wait for #6716 to be completed, or should we put in an issue and revisit this later?

berlin-ab avatar Feb 06 '19 06:02 berlin-ab

I have rebased this and open a new one https://github.com/greenplum-db/gpdb/pull/13923

Close this.

Thanks a lot for the PR.

kainwen avatar Aug 11 '22 00:08 kainwen