From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Running psql in emacs shell generates key conflict error: why?
Date: Tue, 2 Apr 2019 12:47:30 -0700
Message-ID: <3cb3a26e-23c6-2ab4-3177-cba692b8e818@aklaver.com> (raw)
In-Reply-To: <alpine.LNX.2.20.1904020750270.21232@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.1904020750270.21232@salmo.appl-ecosys.com>
On 4/2/19 8:00 AM, Rich Shepard wrote:
> An unexpected result this morning that I'd like to understand. In emacs I
> loaded the file organizations.sql in a buffer to insert new rows in that
> table. Rather than running psql from a virtual console, I opened an emacs
> shell and entered the command,
> psql -f organizations.sql -d bustrac
> and saw an error that the last line in the .sql file was in conflict
> with an
> existing primary key. (I let postgres assign the keys when new rows are
> inserted.)
What was the exact message?
What was in the last line?
>
> Checking the table for that primary key confirmed that it was a different
> organization so there should not have been a conflict.
>
> Using a virtual console, and in the directory with the scripts, I ran the
> same psql command and it completed as expected.
>
> I don't think this is a emacs error because the shell opens in the same
> directory as the script I'm running.
>
> Why might postgres fail to run the script within an emacs shell while
> having
> no issues running the same script from a virtual console?
Difference in shell escaping?
>
> A curious mind wants to learn.
>
> TIA,
>
> Rich
>
>
>
--
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, rshepard@appl-ecosys.com
Subject: Re: Running psql in emacs shell generates key conflict error: why?
In-Reply-To: <3cb3a26e-23c6-2ab4-3177-cba692b8e818@aklaver.com>
References: <alpine.LNX.2.20.1904020750270.21232@salmo.appl-ecosys.com> <3cb3a26e-23c6-2ab4-3177-cba692b8e818@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