I successfully restored a dump from Postgresql 11 into 9.3.9.
postgres=# drop database ambari
DROP DATABASE
[dumps]$ pg_restore -U postgres -h db ambari.dump
-- Dumped from database version 11.7
-- Dumped by pg_dump version 11.7
-- Name: ambari; Type: SCHEMA; Schema: -; Owner: ambari
CREATE SCHEMA ambari;
ALTER SCHEMA ambari OWNER TO ambari;
SET default_tablespace = '';
-- Name: adminpermission; Type: TABLE; Schema: ambari; Owner: ambari
CREATE TABLE ambari.adminpermission (
permission_id bigint NOT NULL,
permission_name character varying(255) NOT NULL,
resource_type_id integer NOT NULL,
permission_label character varying(255),
principal_id bigint NOT NULL,
sort_order smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ambari.adminpermission OWNER TO ambari;
etc
-- PostgreSQL database dump complete
When I list the databases, there is no ambari, but there was in original database.
[dumps]$ psql -U postgres -h db
postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
jiradb7 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
I cannot find it between the schemas either:
postgres=# dn
List of schemas
Name | Owner
public | postgres
postgres-# select nspname from pg_catalog.pg_namespace;
nspname
pg_toast
pg_temp_1
pg_toast_temp_1
pg_catalog
public
information_schema
My question where the ambari schema is?
Go to Source
Author: Leos Literak