Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9yqd-0003nT-SJ for pgsql-sql@arkaria.postgresql.org; Wed, 23 Jul 2014 15:52:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9yqd-0001Bw-Br for pgsql-sql@arkaria.postgresql.org; Wed, 23 Jul 2014 15:52:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9yqc-0001Bq-JP for pgsql-sql@postgresql.org; Wed, 23 Jul 2014 15:52:54 +0000 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X9yqY-0002F9-Qy for pgsql-sql@postgresql.org; Wed, 23 Jul 2014 15:52:53 +0000 Received: by mail-oi0-f41.google.com with SMTP id a141so1011313oig.28 for ; Wed, 23 Jul 2014 08:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=61ftoRSfZdcHjHZdVUscuPV5eZuR9infsEQvpL9WsSU=; b=Ik1Tb2X+QNReH3A96nD+NAQq4n0Wp5arNMlvpLyeExcH6O4S8tloMi8ZXd3gvm4nIa 8ciMmcYxQdHSJwOkNtaY3sWAy0AhPhoZcbGHlakea9vAgKxU16Yvo2su2P+KSE8mZuSt h5BcoZE2+iX0h2qsd9LHCGw9V6w/hyi1ajNsfyE+oNIL7bNUYewpaldwKO7eF+lpSBWs 34Lw7uImKl9ZVfyXDPJ/6F0QO/poB1jMAkoOlO0oeDHTpN6c1NGx36HzJfN0BJQ1uP1W lLQJnGaTpiF7MXJIpy2SBMYLjeRZ9SXAsyiqIyJKW5K7Ku8fU84jRNvcKw5vqC/79RP/ GqqQ== X-Received: by 10.182.199.5 with SMTP id jg5mr3133228obc.75.1406130768089; Wed, 23 Jul 2014 08:52:48 -0700 (PDT) Received: from stability.med.utah.edu (stability.med.utah.edu. [155.100.158.97]) by mx.google.com with ESMTPSA id x10sm5855506obg.24.2014.07.23.08.52.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 08:52:46 -0700 (PDT) Message-ID: <53CFDA42.8010305@gmail.com> Date: Wed, 23 Jul 2014 09:52:34 -0600 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Is CREATE TABLE non-blocking ? References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------090109030102090103020005" X-Pg-Spam-Score: -1.0 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org This is a multi-part message in MIME format. --------------090109030102090103020005 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/23/2014 09:13 AM, Benjamin Dugast wrote: > We finally solved our problem, > Thanks for your help. > > > 2014-07-23 15:43 GMT+02:00 hubert depesz lubaczewski >: > > No, it's not. > What might happen, though, is that you call your callback before > the transaction with create table got committed. > > depesz > > > On Wed, Jul 23, 2014 at 12:33 PM, 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? > > > And the solutions was.... --------------090109030102090103020005 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 07/23/2014 09:13 AM, Benjamin Dugast wrote:
We finally solved our problem,
Thanks for your help.


2014-07-23 15:43 GMT+02:00 hubert depesz lubaczewski <depesz@gmail.com>:
No, it's not.
What might happen, though, is that you call your callback before the transaction with create table got committed.

depesz


On Wed, Jul 23, 2014 at 12:33 PM, Benjamin Dugast <bdugast@excilys.com> 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?


And the solutions was....


--------------090109030102090103020005--