Running psql in emacs shell generates key conflict error: why?

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Running psql in emacs shell generates key conflict error: why?
Date: 2019-04-02 15:00:47
Message-ID: alpine.LNX.2.20.1904020750270.21232@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.)

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?

A curious mind wants to learn.

TIA,

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Clarke 2019-04-02 15:04:55 Re: logical replication - negative bitmapset member not allowed
Previous Message Tom Lane 2019-04-02 14:46:11 Re: logical replication - negative bitmapset member not allowed