Re: What could cause a temp table to disappear?

From: François Beausoleil <francois(at)teksol(dot)info>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: What could cause a temp table to disappear?
Date: 2013-02-27 21:48:35
Message-ID: E79809EE-690F-4198-9E3C-1C90F9ECB285@teksol.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Le 2013-02-27 à 16:45, Adrian Klaver a écrit :

> On 02/27/2013 01:19 PM, François Beausoleil wrote:
>
>>
>> Any hints?
>
> See in line notes below.
> Also what client/library are you using to connect with?

I use Ruby & Sequel. Sequel is a very thin library over straight SQL.

>> NOTE: Log cut at 120 characters wide for easier viewing.
>>
>> [INFO ] binding-data-persister:14072 - (0.006859s) CREATE TEMPORARY TABLE airings_import( LIKE airings INCLUDING ALL ) ON COMMIT DROP
>> [INFO ] binding-data-persister:14072 - (0.103249s) INSERT INTO "airings_import" ("airing_id", "channel_id", "show_id", "start_at", "end_at") VALUES ('61ec
>> ...
>> [INFO ] binding-data-persister:14072 - (0.089145s) INSERT INTO "airings_import" ("airing_id", "channel_id", "show_id", "start_at", "end_at") VALUES ('03ea
>
>
> So what is happening below and does that happen on dev?
>
>> [INFO ] binding-data-persister:14072 - (0.011618s) TRUNCATE TABLE "markets"
>> [INFO ] binding-data-persister:14072 - (0.006574s) INSERT INTO "markets" SELECT * FROM "markets_import" RETURNING "market_id"
>> [INFO ] binding-data-persister:14072 - (0.004189s) TRUNCATE TABLE "channels"
>> [INFO ] binding-data-persister:14072 - (0.008122s) INSERT INTO "channels" SELECT * FROM "channels_import" RETURNING "channel_id"
>> [INFO ] binding-data-persister:14072 - (0.003201s) TRUNCATE TABLE "channel_market_memberships"
>> [INFO ] binding-data-persister:14072 - (0.006054s) INSERT INTO "channel_market_memberships" SELECT * FROM "channel_market_memberships_import" RETURNING "m
>> [INFO ] binding-data-persister:14072 - (0.011205s) TRUNCATE TABLE "shows"
>> [INFO ] binding-data-persister:14072 - (0.063107s) INSERT INTO "shows" SELECT * FROM "shows_import" RETURNING "show_id"
>> [INFO ] binding-data-persister:14072 - (0.008198s) TRUNCATE TABLE "episodes"
>> [INFO ] binding-data-persister:14072 - (0.738297s) INSERT INTO "episodes" SELECT * FROM "episodes_import" RETURNING "episode_id"
>> [INFO ] binding-data-persister:14072 - (0.004846s) TRUNCATE TABLE "producers"
>> [INFO ] binding-data-persister:14072 - (0.005278s) INSERT INTO "producers" SELECT * FROM "producers_import" RETURNING "producer_id"
>> [ERROR] binding-data-persister:14072 - PG::Error: ERROR: relation "airings_import" does not exist
>> [INFO ] binding-data-persister:14072 - (1.583302s) ROLLBACK

This is the production log, and it's the exact same in dev. The data I'm putting in the tables is authoritative, except for airings, which may or may not already exist in the database. In dev, the INSERT INTO airings SELECT * FROM airings_import WHERE NOT EXISTS(...) statement runs to completion. That's why I'm puzzled.

Bye,
François

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-02-27 21:54:05 Re: What could cause a temp table to disappear?
Previous Message Adrian Klaver 2013-02-27 21:45:00 Re: What could cause a temp table to disappear?