Re: CREATE TABLE AS SELECT hangs - Mailing list pgsql-general

From derek
Subject Re: CREATE TABLE AS SELECT hangs
Date
Msg-id 062f1b33-f588-7689-1374-14ac31872345@uwf.edu
Whole thread Raw
In response to Re: CREATE TABLE AS SELECT hangs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom.

Thanks so much for your response. Your theory appears to have been 
correct, and it is working like a champ now.

Best,

Derek

On 10/1/2018 4:29 PM, Tom Lane wrote:
> 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



pgsql-general by date:

Previous
From: Jan Kohnert
Date:
Subject: Postgres 11 procedures and result sets
Next
From: Tom Lane
Date:
Subject: Re: Postgres 11 procedures and result sets