Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9xMw-00065b-R2 for pgsql-sql@arkaria.postgresql.org; Wed, 23 Jul 2014 14:18:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9xMw-0002De-7T for pgsql-sql@arkaria.postgresql.org; Wed, 23 Jul 2014 14:18:10 +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 1X9xMv-0002DY-JU for pgsql-sql@postgresql.org; Wed, 23 Jul 2014 14:18:09 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X9xMr-0000Lc-6k for pgsql-sql@postgresql.org; Wed, 23 Jul 2014 14:18:08 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1X9xMm-0000L8-CT for pgsql-sql@postgresql.org; Wed, 23 Jul 2014 07:18:00 -0700 Date: Wed, 23 Jul 2014 07:18:00 -0700 (PDT) From: David G Johnston To: pgsql-sql@postgresql.org Message-ID: <1406125080365-5812524.post@n5.nabble.com> In-Reply-To: References: Subject: Re: Is CREATE TABLE non-blocking ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) 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 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