pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: derek <jmorgan3@uwf.edu>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: CREATE TABLE AS SELECT hangs
Date: Mon, 01 Oct 2018 17:29:19 -0400
Message-ID: <30054.1538429359@sss.pgh.pa.us> (raw)
In-Reply-To: <b784c00b-e716-acd5-4674-ffe12ba49b93@uwf.edu>
References: <b784c00b-e716-acd5-4674-ffe12ba49b93@uwf.edu>

derek <jmorgan3@uwf.edu> writes:
> I am trying to populate/create a database with CREATE TABLE AS SELECT 
> like so:

>     CREATE TABLE test_table AS
>     SELECT row_number() over() as gid, cells.geom
>     FROM test_geom_function(1,2,3) AS cells;

> This works on one database instance, but not on another. On the database 
> it doesn't work on it seems to hang on executing and when I cancel it I get

>     ERROR:  canceling statement due to user request
>     CONTEXT:  while inserting index tuple (6,13) in relation
>     "pg_type_typname_nsp_index"
>     SQL state: 57014

Hmm (pokes around) ... That error context message seems to only be
possible if we were blocked waiting for some other transaction.
I theorize that you have an uncommitted transaction someplace that
has created the same table name.  Cancelling it would fix things.

			regards, tom lane




view thread (3+ messages)  latest in thread

Message-ID: <30054.1538429359@sss.pgh.pa.us>
Permalink:  ../30054.1538429359@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30054.1538429359@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, jmorgan3@uwf.edu
  Subject: Re: CREATE TABLE AS SELECT hangs
  In-Reply-To: <30054.1538429359@sss.pgh.pa.us>
  References: <b784c00b-e716-acd5-4674-ffe12ba49b93@uwf.edu> <30054.1538429359@sss.pgh.pa.us>

* 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