Re: CREATE TABLE AS SELECT hangs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: derek <jmorgan3(at)uwf(dot)edu>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: CREATE TABLE AS SELECT hangs
Date: 2018-10-01 21:29:19
Message-ID: 30054.1538429359@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

derek <jmorgan3(at)uwf(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Kohnert 2018-10-01 21:53:54 Postgres 11 procedures and result sets
Previous Message Carl Sverre 2018-10-01 20:45:22 Re: Postgres trigger side-effect is occurring out of order with row-level security select policy