Hi there!
I’m having trouble importing a postgres database into the system. Below all this I am going to post my pg_dump output and add a screenshot of the error as well.
Could I get some recommendations on what to do here?
screenshot of error:
Hi there!
I’m having trouble importing a postgres database into the system. Below all this I am going to post my pg_dump output and add a screenshot of the error as well.
Could I get some recommendations on what to do here?
screenshot of error:
Hi Blake,
Currently, we haven’t supported some syntax of PostgreSQL. We’re working on the parser to support more Postgres syntax.
But now, I suggest whenever you see the error warning on the line that doesn’t affect the visualization (ex: COMMENT ON, CREATE SEQUENCE,etc …), just delete the entire line
Here is your file after we remove all the unsupported syntax:
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.3
-- Dumped by pg_dump version 11.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: citext; Type: EXTENSION; Schema: -; Owner:
--
--
-- Name: EXTENSION citext; Type: COMMENT; Schema: -; Owner:
--
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: auth_group; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.auth_group (
id integer NOT NULL,
name character varying(150) NOT NULL
);
ALTER TABLE public.auth_group OWNER TO lang_chat;
--
-- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.auth_group_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.auth_group_id_seq OWNER TO lang_chat;
--
-- Name: auth_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.auth_group_permissions (
id integer NOT NULL,
group_id integer NOT NULL,
permission_id integer NOT NULL
);
ALTER TABLE public.auth_group_permissions OWNER TO lang_chat;
--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.auth_group_permissions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.auth_group_permissions_id_seq OWNER TO lang_chat;
--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: auth_permission; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.auth_permission (
id integer NOT NULL,
name character varying(255) NOT NULL,
content_type_id integer NOT NULL,
codename character varying(100) NOT NULL
);
ALTER TABLE public.auth_permission OWNER TO lang_chat;
--
-- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.auth_permission_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.auth_permission_id_seq OWNER TO lang_chat;
--
-- Name: auth_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: authtoken_token; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.authtoken_token (
key character varying(40) NOT NULL,
created timestamp with time zone NOT NULL,
user_id integer NOT NULL
);
ALTER TABLE public.authtoken_token OWNER TO lang_chat;
--
-- Name: chat_app_language; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.chat_app_language (
id integer NOT NULL,
abbreviated_name character varying(10) NOT NULL,
name text NOT NULL
);
ALTER TABLE public.chat_app_language OWNER TO lang_chat;
--
-- Name: chat_app_language_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.chat_app_language_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chat_app_language_id_seq OWNER TO lang_chat;
--
-- Name: chat_app_language_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_message; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.chat_app_message (
id integer NOT NULL,
message text NOT NULL,
"timestamp" timestamp with time zone NOT NULL,
room_id integer NOT NULL,
user_id integer NOT NULL,
reference_id integer
);
ALTER TABLE public.chat_app_message OWNER TO lang_chat;
--
-- Name: chat_app_message_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.chat_app_message_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chat_app_message_id_seq OWNER TO lang_chat;
--
-- Name: chat_app_message_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_room; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.chat_app_room (
id integer NOT NULL,
name text NOT NULL,
language_id integer NOT NULL
);
ALTER TABLE public.chat_app_room OWNER TO lang_chat;
--
-- Name: chat_app_room_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.chat_app_room_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chat_app_room_id_seq OWNER TO lang_chat;
--
-- Name: chat_app_room_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_user; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.chat_app_user (
id integer NOT NULL,
password character varying(128) NOT NULL,
last_login timestamp with time zone,
is_superuser boolean NOT NULL,
username character varying(150) NOT NULL,
first_name character varying(30) NOT NULL,
last_name character varying(150) NOT NULL,
email character varying(254) NOT NULL,
is_staff boolean NOT NULL,
is_active boolean NOT NULL,
date_joined timestamp with time zone NOT NULL,
country_of_origin text NOT NULL
);
ALTER TABLE public.chat_app_user OWNER TO lang_chat;
--
-- Name: chat_app_user_groups; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.chat_app_user_groups (
id integer NOT NULL,
user_id integer NOT NULL,
group_id integer NOT NULL
);
ALTER TABLE public.chat_app_user_groups OWNER TO lang_chat;
--
-- Name: chat_app_user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.chat_app_user_groups_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chat_app_user_groups_id_seq OWNER TO lang_chat;
--
-- Name: chat_app_user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_user_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.chat_app_user_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chat_app_user_id_seq OWNER TO lang_chat;
--
-- Name: chat_app_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_user_user_permissions; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.chat_app_user_user_permissions (
id integer NOT NULL,
user_id integer NOT NULL,
permission_id integer NOT NULL
);
ALTER TABLE public.chat_app_user_user_permissions OWNER TO lang_chat;
--
-- Name: chat_app_user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.chat_app_user_user_permissions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chat_app_user_user_permissions_id_seq OWNER TO lang_chat;
--
-- Name: chat_app_user_user_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: django_admin_log; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.django_admin_log (
id integer NOT NULL,
action_time timestamp with time zone NOT NULL,
object_id text,
object_repr character varying(200) NOT NULL,
action_flag smallint NOT NULL,
change_message text NOT NULL,
content_type_id integer,
user_id integer NOT NULL,
);
ALTER TABLE public.django_admin_log OWNER TO lang_chat;
--
-- Name: django_admin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.django_admin_log_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.django_admin_log_id_seq OWNER TO lang_chat;
--
-- Name: django_admin_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: django_content_type; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.django_content_type (
id integer NOT NULL,
app_label character varying(100) NOT NULL,
model character varying(100) NOT NULL
);
ALTER TABLE public.django_content_type OWNER TO lang_chat;
--
-- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.django_content_type_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.django_content_type_id_seq OWNER TO lang_chat;
--
-- Name: django_content_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: django_migrations; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.django_migrations (
id integer NOT NULL,
app character varying(255) NOT NULL,
name character varying(255) NOT NULL,
applied timestamp with time zone NOT NULL
);
ALTER TABLE public.django_migrations OWNER TO lang_chat;
--
-- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: lang_chat
--
CREATE SEQUENCE public.django_migrations_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.django_migrations_id_seq OWNER TO lang_chat;
--
-- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: lang_chat
--
--
-- Name: django_session; Type: TABLE; Schema: public; Owner: lang_chat
--
CREATE TABLE public.django_session (
session_key character varying(40) NOT NULL,
session_data text NOT NULL,
expire_date timestamp with time zone NOT NULL
);
ALTER TABLE public.django_session OWNER TO lang_chat;
--
-- Name: auth_group id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_group ALTER COLUMN id SET DEFAULT nextval('public.auth_group_id_seq'::regclass);
--
-- Name: auth_group_permissions id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_group_permissions ALTER COLUMN id SET DEFAULT nextval('public.auth_group_permissions_id_seq'::regclass);
--
-- Name: auth_permission id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_permission ALTER COLUMN id SET DEFAULT nextval('public.auth_permission_id_seq'::regclass);
--
-- Name: chat_app_language id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_language ALTER COLUMN id SET DEFAULT nextval('public.chat_app_language_id_seq'::regclass);
--
-- Name: chat_app_message id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_message ALTER COLUMN id SET DEFAULT nextval('public.chat_app_message_id_seq'::regclass);
--
-- Name: chat_app_room id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_room ALTER COLUMN id SET DEFAULT nextval('public.chat_app_room_id_seq'::regclass);
--
-- Name: chat_app_user id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user ALTER COLUMN id SET DEFAULT nextval('public.chat_app_user_id_seq'::regclass);
--
-- Name: chat_app_user_groups id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_groups ALTER COLUMN id SET DEFAULT nextval('public.chat_app_user_groups_id_seq'::regclass);
--
-- Name: chat_app_user_user_permissions id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_user_permissions ALTER COLUMN id SET DEFAULT nextval('public.chat_app_user_user_permissions_id_seq'::regclass);
--
-- Name: django_admin_log id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_admin_log ALTER COLUMN id SET DEFAULT nextval('public.django_admin_log_id_seq'::regclass);
--
-- Name: django_content_type id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_content_type ALTER COLUMN id SET DEFAULT nextval('public.django_content_type_id_seq'::regclass);
--
-- Name: django_migrations id; Type: DEFAULT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_migrations ALTER COLUMN id SET DEFAULT nextval('public.django_migrations_id_seq'::regclass);
--
-- Data for Name: auth_group; Type: TABLE DATA; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.auth_group_id_seq', 1, false);
--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.auth_group_permissions_id_seq', 1, false);
--
-- Name: auth_permission_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.auth_permission_id_seq', 40, true);
--
-- Name: chat_app_language_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.chat_app_language_id_seq', 2, true);
--
-- Name: chat_app_message_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.chat_app_message_id_seq', 19, true);
--
-- Name: chat_app_room_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.chat_app_room_id_seq', 2, true);
--
-- Name: chat_app_user_groups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.chat_app_user_groups_id_seq', 1, false);
--
-- Name: chat_app_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.chat_app_user_id_seq', 4, true);
--
-- Name: chat_app_user_user_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.chat_app_user_user_permissions_id_seq', 1, false);
--
-- Name: django_admin_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.django_admin_log_id_seq', 1, false);
--
-- Name: django_content_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.django_content_type_id_seq', 10, true);
--
-- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: lang_chat
--
SELECT pg_catalog.setval('public.django_migrations_id_seq', 30, true);
--
-- Name: auth_group auth_group_name_key; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: auth_group_permissions auth_group_permissions_group_id_permission_id_0cd325b0_uniq; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: auth_group_permissions auth_group_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_group_permissions
ADD CONSTRAINT auth_group_permissions_pkey PRIMARY KEY (id);
--
-- Name: auth_group auth_group_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_group
ADD CONSTRAINT auth_group_pkey PRIMARY KEY (id);
--
-- Name: auth_permission auth_permission_content_type_id_codename_01ab375a_uniq; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: auth_permission auth_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_permission
ADD CONSTRAINT auth_permission_pkey PRIMARY KEY (id);
--
-- Name: authtoken_token authtoken_token_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.authtoken_token
ADD CONSTRAINT authtoken_token_pkey PRIMARY KEY (key);
--
-- Name: authtoken_token authtoken_token_user_id_key; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_language chat_app_language_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_language
ADD CONSTRAINT chat_app_language_pkey PRIMARY KEY (id);
--
-- Name: chat_app_message chat_app_message_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_message
ADD CONSTRAINT chat_app_message_pkey PRIMARY KEY (id);
--
-- Name: chat_app_room chat_app_room_name_8e6cb6ca_uniq; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_room chat_app_room_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_room
ADD CONSTRAINT chat_app_room_pkey PRIMARY KEY (id);
--
-- Name: chat_app_user_groups chat_app_user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_groups
ADD CONSTRAINT chat_app_user_groups_pkey PRIMARY KEY (id);
--
-- Name: chat_app_user_groups chat_app_user_groups_user_id_group_id_69b1a696_uniq; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_user chat_app_user_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user
ADD CONSTRAINT chat_app_user_pkey PRIMARY KEY (id);
--
-- Name: chat_app_user_user_permissions chat_app_user_user_permi_user_id_permission_id_57305b8a_uniq; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: chat_app_user_user_permissions chat_app_user_user_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_user_permissions
ADD CONSTRAINT chat_app_user_user_permissions_pkey PRIMARY KEY (id);
--
-- Name: chat_app_user chat_app_user_username_key; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: django_admin_log django_admin_log_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_admin_log
ADD CONSTRAINT django_admin_log_pkey PRIMARY KEY (id);
--
-- Name: django_content_type django_content_type_app_label_model_76bd3d3b_uniq; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
--
-- Name: django_content_type django_content_type_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_content_type
ADD CONSTRAINT django_content_type_pkey PRIMARY KEY (id);
--
-- Name: django_migrations django_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_migrations
ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id);
--
-- Name: django_session django_session_pkey; Type: CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_session
ADD CONSTRAINT django_session_pkey PRIMARY KEY (session_key);
--
-- Name: auth_group_name_a6ea08ec_like; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX auth_group_name_a6ea08ec_like ON public.auth_group USING btree (name);
--
-- Name: auth_group_permissions_group_id_b120cbf9; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX auth_group_permissions_group_id_b120cbf9 ON public.auth_group_permissions USING btree (group_id);
--
-- Name: auth_group_permissions_permission_id_84c5c92e; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX auth_group_permissions_permission_id_84c5c92e ON public.auth_group_permissions USING btree (permission_id);
--
-- Name: auth_permission_content_type_id_2f476e4b; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX auth_permission_content_type_id_2f476e4b ON public.auth_permission USING btree (content_type_id);
--
-- Name: authtoken_token_key_10f0b77e_like; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX authtoken_token_key_10f0b77e_like ON public.authtoken_token USING btree (key);
--
-- Name: chat_app_message_reference_id_6f287e44; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_message_reference_id_6f287e44 ON public.chat_app_message USING btree (reference_id);
--
-- Name: chat_app_message_room_id_42b1602b; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_message_room_id_42b1602b ON public.chat_app_message USING btree (room_id);
--
-- Name: chat_app_message_timestamp_520345f1; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_message_timestamp_520345f1 ON public.chat_app_message USING btree ("timestamp");
--
-- Name: chat_app_message_user_id_da52ec2a; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_message_user_id_da52ec2a ON public.chat_app_message USING btree (user_id);
--
-- Name: chat_app_room_language_id_02ad2473; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_room_language_id_02ad2473 ON public.chat_app_room USING btree (language_id);
--
-- Name: chat_app_room_name_8e6cb6ca_like; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_room_name_8e6cb6ca_like ON public.chat_app_room USING btree (name);
--
-- Name: chat_app_user_groups_group_id_c42b0396; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_user_groups_group_id_c42b0396 ON public.chat_app_user_groups USING btree (group_id);
--
-- Name: chat_app_user_groups_user_id_0847901e; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_user_groups_user_id_0847901e ON public.chat_app_user_groups USING btree (user_id);
--
-- Name: chat_app_user_user_permissions_permission_id_0a0eb98e; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_user_user_permissions_permission_id_0a0eb98e ON public.chat_app_user_user_permissions USING btree (permission_id);
--
-- Name: chat_app_user_user_permissions_user_id_9046fadc; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_user_user_permissions_user_id_9046fadc ON public.chat_app_user_user_permissions USING btree (user_id);
--
-- Name: chat_app_user_username_52e0d78f_like; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX chat_app_user_username_52e0d78f_like ON public.chat_app_user USING btree (username);
--
-- Name: django_admin_log_content_type_id_c4bce8eb; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX django_admin_log_content_type_id_c4bce8eb ON public.django_admin_log USING btree (content_type_id);
--
-- Name: django_admin_log_user_id_c564eba6; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX django_admin_log_user_id_c564eba6 ON public.django_admin_log USING btree (user_id);
--
-- Name: django_session_expire_date_a5c62663; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX django_session_expire_date_a5c62663 ON public.django_session USING btree (expire_date);
--
-- Name: django_session_session_key_c0390e0f_like; Type: INDEX; Schema: public; Owner: lang_chat
--
CREATE INDEX django_session_session_key_c0390e0f_like ON public.django_session USING btree (session_key);
--
-- Name: auth_group_permissions auth_group_permissio_permission_id_84c5c92e_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_group_permissions
ADD CONSTRAINT auth_group_permissio_permission_id_84c5c92e_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES public.auth_permission(id);
--
-- Name: auth_group_permissions auth_group_permissions_group_id_b120cbf9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_group_permissions
ADD CONSTRAINT auth_group_permissions_group_id_b120cbf9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES public.auth_group(id);
--
-- Name: auth_permission auth_permission_content_type_id_2f476e4b_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.auth_permission
ADD CONSTRAINT auth_permission_content_type_id_2f476e4b_fk_django_co FOREIGN KEY (content_type_id) REFERENCES public.django_content_type(id);
--
-- Name: authtoken_token authtoken_token_user_id_35299eff_fk_chat_app_user_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.authtoken_token
ADD CONSTRAINT authtoken_token_user_id_35299eff_fk_chat_app_user_id FOREIGN KEY (user_id) REFERENCES public.chat_app_user(id);
--
-- Name: chat_app_message chat_app_message_reference_id_6f287e44_fk_chat_app_message_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_message
ADD CONSTRAINT chat_app_message_reference_id_6f287e44_fk_chat_app_message_id FOREIGN KEY (reference_id) REFERENCES public.chat_app_message(id);
--
-- Name: chat_app_message chat_app_message_room_id_42b1602b_fk_chat_app_room_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_message
ADD CONSTRAINT chat_app_message_room_id_42b1602b_fk_chat_app_room_id FOREIGN KEY (room_id) REFERENCES public.chat_app_room(id);
--
-- Name: chat_app_message chat_app_message_user_id_da52ec2a_fk_chat_app_user_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_message
ADD CONSTRAINT chat_app_message_user_id_da52ec2a_fk_chat_app_user_id FOREIGN KEY (user_id) REFERENCES public.chat_app_user(id);
--
-- Name: chat_app_room chat_app_room_language_id_02ad2473_fk_chat_app_language_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_room
ADD CONSTRAINT chat_app_room_language_id_02ad2473_fk_chat_app_language_id FOREIGN KEY (language_id) REFERENCES public.chat_app_language(id);
--
-- Name: chat_app_user_groups chat_app_user_groups_group_id_c42b0396_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_groups
ADD CONSTRAINT chat_app_user_groups_group_id_c42b0396_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES public.auth_group(id);
--
-- Name: chat_app_user_groups chat_app_user_groups_user_id_0847901e_fk_chat_app_user_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_groups
ADD CONSTRAINT chat_app_user_groups_user_id_0847901e_fk_chat_app_user_id FOREIGN KEY (user_id) REFERENCES public.chat_app_user(id);
--
-- Name: chat_app_user_user_permissions chat_app_user_user_p_permission_id_0a0eb98e_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_user_permissions
ADD CONSTRAINT chat_app_user_user_p_permission_id_0a0eb98e_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES public.auth_permission(id);
--
-- Name: chat_app_user_user_permissions chat_app_user_user_p_user_id_9046fadc_fk_chat_app_; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.chat_app_user_user_permissions
ADD CONSTRAINT chat_app_user_user_p_user_id_9046fadc_fk_chat_app_ FOREIGN KEY (user_id) REFERENCES public.chat_app_user(id);
--
-- Name: django_admin_log django_admin_log_content_type_id_c4bce8eb_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_admin_log
ADD CONSTRAINT django_admin_log_content_type_id_c4bce8eb_fk_django_co FOREIGN KEY (content_type_id) REFERENCES public.django_content_type(id);
--
-- Name: django_admin_log django_admin_log_user_id_c564eba6_fk_chat_app_user_id; Type: FK CONSTRAINT; Schema: public; Owner: lang_chat
--
ALTER TABLE ONLY public.django_admin_log
ADD CONSTRAINT django_admin_log_user_id_c564eba6_fk_chat_app_user_id FOREIGN KEY (user_id) REFERENCES public.chat_app_user(id);
--
-- PostgreSQL database dump complete
--
Hi Duy,
Thank you so much for the help with this! I just tested it and it worked great.
Cheers,
Blake
Is this supported now? I got a pro version and unable to use import from postgre. My schema is too big and keep on giving me issues and unable to generate diagram. Tried deleting lines as you said, but its too long of a list and is there any way to address it?
Hi,
We’ve improved the importer features. Now you can include almost any ALTER syntax in your dump without error.
Thanks.
I’ve had trouble importing SQL with CREATE TYPE, CREATE EXTENSION, CREATE AGGREGATE, CREATE FUNCTION, type casts, public schema prefixes, and varying.
I also have issues if I import a subset of tables and there are references to other tables not contained in the subset.
I have a script to workaround these issues but this is something dbdiagram should do a much better job of handling.
sql = sql.replace(/CREATE TYPE\b(.|\s|\n)*?;/g, "")
sql = sql.replace(/CREATE EXTENSION\b(.|\s|\n)*?;/g, "")
sql = sql.replace(/CREATE AGGREGATE\b(.|\s|\n)*?;/g, "")
sql = sql.replace(/CREATE FUNCTION\b(.|\s|\n)*?AS \$_\$(.|\s|\n)*?\$_\$\s*;/g, "")
sql = sql.replace(/::\w+/g, " ")
sql = sql.replace(/ varying /g, " ")
sql = sql.replace(/ public\./g, " ")