From: Adrian Klaver <adrian.klaver@aklaver.com>
To: arden liu <ardenbook@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: psql show me the : and ask user input, when running one sql file
Date: Sun, 5 Apr 2020 11:09:03 -0700
Message-ID: <e46da5bf-80e2-fb79-7ea6-f5544d676b2b@aklaver.com> (raw)
In-Reply-To: <CAK0Kdk=2mKy9hL0wMcDOJrcLYOdesSdLz_yYNBp0=wRgfHAY-A@mail.gmail.com>
References: <CAK0Kdkmw2buewJ1cW02XJM+D2mWz_vd+5k7xZ4ctPkjbFSdiwA@mail.gmail.com>
<86019357-d505-846a-40e4-76e90926e029@aklaver.com>
<b173d309-6f0f-45a2-075d-1cb94d02b528@aklaver.com>
<CAK0Kdk=2mKy9hL0wMcDOJrcLYOdesSdLz_yYNBp0=wRgfHAY-A@mail.gmail.com>
On 4/5/20 10:51 AM, arden liu wrote:
> Does that RETURNING need any user input?
No. I just think actually returning those thousands of values is
stalling the shell. It also not really necessary for the loading as
'INSERT 0 4333' shows you what you need to know. Unless you have super
vision and recall you are not going to track those values anyway. You
can verify in the table itself.
I would see if you could get the project to output the file using COPY
to load the tables instead of INSERT anyway. The file is pretty much
Postgres specific anyway as it doing things like:
1) DROP SCHEMA public CASCADE; create SCHEMA public;
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
-- HF - must have conforming strings on for Postgres interface to work,
as it will include Windows paths sometimes
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
2) ALTER TYPE public.ancestry OWNER TO postgres;
>
> On Sun., Apr. 5, 2020, 1:10 p.m. Adrian Klaver,
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 4/5/20 9:46 AM, Adrian Klaver wrote:
> > On 4/5/20 5:50 AM, arden liu wrote:
>
> > 4) I don't see anything wrong the statements, so I am wondering
> if it is
> > a shell issue?
>
> Seems to be. I removed the RETURNING *_id from the INSERT statements
> and
> the file ran without interruption:
>
> ...
> CREATE TABLE
> ALTER TABLE
> INSERT 0 4333
> INSERT 0 9326
> INSERT 0 13
> ALTER TABLE
> ALTER TABLE
> ...
>
> >
> >
> >
> >> Thanks.
> >> Arden
> >
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, ardenbook@gmail.com
Subject: Re: psql show me the : and ask user input, when running one sql file
In-Reply-To: <e46da5bf-80e2-fb79-7ea6-f5544d676b2b@aklaver.com>
References: <CAK0Kdkmw2buewJ1cW02XJM+D2mWz_vd+5k7xZ4ctPkjbFSdiwA@mail.gmail.com> <86019357-d505-846a-40e4-76e90926e029@aklaver.com> <b173d309-6f0f-45a2-075d-1cb94d02b528@aklaver.com> <CAK0Kdk=2mKy9hL0wMcDOJrcLYOdesSdLz_yYNBp0=wRgfHAY-A@mail.gmail.com> <e46da5bf-80e2-fb79-7ea6-f5544d676b2b@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox