Pozdrav, Arni On 08/08/2019 14.46, Luca Ferrari wrote: > On Thu, Aug 8, 2019 at 2:21 PM Arni <Arni.Kromic@xxxxxxxxxxx> wrote: >> This works! I get: >> oid | nspname >> -------+-------------------- >> 16385 | HR16101766338-2018 >> (1 row) >> >> I get the same thing if I try with '%HR16101766338-2018'. So it seems as >> if there were some characters prepended to the name... I've checked for >> spaces, but there are none. What could this mean? >> > Can you inspect output of > SELECT oid, nspname, quote_ident( nspname ) FROM pg_namespace WHERE > nspname = '%HR1610%' > > and see if there's a character provoking this (could it need to be > redirect to a file and inspect with an editor). > I suspect this is the problem why your schema cannot be "named" as it is. I've rechecked and I see that SELECT oid, nspname FROM pg_namespace WHERE nspname = 'HR16101766338-2018'; ...actually works as it should, returns the name and the oid. However, clone_schema claims it doesn't exist, and so does pg_dump. I've base64 encoded the name and decoded it into a file which I inspected in hex. All character bytes are ok. > On a desperate approach, I would try to update pg_namespace to force > the naming of such schema, but I don't tend to work against the > catalog in production...and since you don't seem to have a backup I > would do a few more experiments first. I do have a backup, and I have restored it to another database for experimenting. I'd accept any dangerous ideas. :) And I still don't get why PGAdmin4 doesn't work or why it returns that 'table_oid' message. > Luca > > > -- Arni