agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Is CREATE TABLE non-blocking ?
Date: Wed, 23 Jul 2014 07:18:00 -0700 (PDT)
Message-ID: <1406125080365-5812524.post@n5.nabble.com> (raw)
In-Reply-To: <CAB9ggRr-DJXb6ha7=KDd6W1WZAdcNkmULR0fv1J_TS3WO5+VGw@mail.gmail.com>
References: <CAB9ggRr-DJXb6ha7=KDd6W1WZAdcNkmULR0fv1J_TS3WO5+VGw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Benjamin Dugast wrote
> Hello,
> 
> We have an issue with tables creations in our application.
> 
> We think CREATE TABLE returns before the tables are created. Because this
> looks like a non-blocking operation, our inserts (in a callback) are
> actually happening before the tables are created.
> 
> We tried to use a Thread.sleep() just before the insert and it works but
> we
> can't stay with this.
> 
> What can we do to avoid this problem?

Nothing in the server is asynchronous (expect maybe notify/listen) but that
doesn't prevent you from interacting with the server in an asynchronous way
client-side.

Showing code usually helps people provide suggestions on how to avoid a
problem.

David J.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/Is-CREATE-TABLE-non-blocking-tp5812506p5812524.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (6+ messages)  latest in thread

Message-ID: <1406125080365-5812524.post@n5.nabble.com>
Permalink:  ../1406125080365-5812524.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1406125080365-5812524.post@n5.nabble.com

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: Is CREATE TABLE non-blocking ?
  In-Reply-To: <1406125080365-5812524.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox