Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQcoM-0001J1-MN for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:46:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQcoL-0002Yr-Jw for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:46:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQcoL-0002Yk-C9 for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:46:49 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kQcoJ-0001Kg-9d for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:46:48 +0000 Received: by mail-pg1-x542.google.com with SMTP id x16so5347901pgj.3 for ; Thu, 08 Oct 2020 13:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=7worYOZRjNqIq+ESlYv8ANKhnF90Fst5BLLwVTT/aIg=; b=g9ViWtUiiKGJ5iwoWkhFEGm5OTaAPZ4YYr9m3OlUQ3D4NALRB7z9G1ZRy13GbYEgK3 ceYmjshVLHHeClU4P/XnHfRjqQG4VG32CokjccLFO9uQSJqqaUrjbBKQ6s8RXGNbNxXF S7yfR9shWJYTCFjW0nOvJtBPHSZOUZqmb4biJ3d/Vkj7ayp0PwsYgxUNP25PCm5Jr/NV 79xJ53sWTlPgG/P9dO0FQW30BS/DeGOVvgDsDbDAvTAi0HfZhRw7NvoC/699OSPwFqvN qLKljYV9yQfBbJh+hARFJN8Pbje07xMGZZke2CW2AcIKXXK7Vl716WgM54COiJqtZ0ji RPxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=7worYOZRjNqIq+ESlYv8ANKhnF90Fst5BLLwVTT/aIg=; b=n1b6Wfupm31UDHfjPZ8K7H8ONbIDE+qbbTVrg/AWVjbM30u84+Cu9NdGHAAsBhq6jF nptIoSO9XDI2p0zAc+KTHePRipP0goQFSy5R+XP0blV150mrRDAaV8tJExiqvEvMvzoT 1eMLhwG5JrAtBkYWUE7sCNX0tzv3+Ntq9HRMGxzzGPqzlEHa91WicA05U9fObeUOuKL9 A8eTPV99Y+Phfb4XvPoTZpN9rTjik1HgOOOPtteTSKHd9dK6Ta7JlUL44GeX0FtwYfkS N2bVMA+oBL8XJ2rmXFqzMUi4wRFowA2iwA3bYhe6CvD3GyzElhNyx0slJxdx2aKNDOcZ TV5Q== X-Gm-Message-State: AOAM530DiLjjw3bPEXX511C48fbgLMJUPm5jM+e42++6x7QqFF+5qiKz eiswAgy+dWakBtVLQNxVFyXDI9fQdnQ= X-Google-Smtp-Source: ABdhPJz03E82nYuaNXVRcqO7XxpWffmdo5wus2K2mv9fPKPBvMyGtpX8SV0z/eIJhSwD0FBKJdVbyA== X-Received: by 2002:a65:60d0:: with SMTP id r16mr642837pgv.348.1602190004756; Thu, 08 Oct 2020 13:46:44 -0700 (PDT) Received: from pavlo-debian ([204.147.87.6]) by smtp.gmail.com with ESMTPSA id 138sm8478217pfu.180.2020.10.08.13.46.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 13:46:44 -0700 (PDT) Message-ID: <47a7c4ffa62aaf2b86854a657f484f33913207c9.camel@gmail.com> Subject: Re: libpq CREATE DATABASE operation from multiple treads From: p.sun.fun@gmail.com To: "pgsql-sql@lists.postgresql.org" Date: Thu, 08 Oct 2020 15:46:40 -0500 In-Reply-To: <058A9601-35F6-42C1-AC4C-8DD4643E418F@gmail.com> References: <390804abe88e4e9da9049f6e05c841783acaca47.camel@gmail.com> <124ce8dff8402159f20dec1bc1ac27e26ee39c23.camel@gmail.com> <96718FB0-E258-4342-BD6E-BCE6603BCBD5@gmail.com> <058A9601-35F6-42C1-AC4C-8DD4643E418F@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-10-08 at 14:43 -0600, Rob Sargent wrote: > > > > On Oct 8, 2020, at 2:41 PM, p.sun.fun@gmail.com wrote: > > > > On Thu, 2020-10-08 at 14:35 -0600, Rob Sargent wrote: > > > > On Oct 8, 2020, at 2:30 PM, p.sun.fun@gmail.com wrote: > > > > > > > > Indeed, this is a FATAL_ERROR. From two threads I got: > > > > > > > > // Thread #1 > > > > FATAL_ERROR: ERROR: source database "template1" is being > > > > accessed > > > > by > > > > other users > > > > DETAIL: There is 1 other session using the database. > > > > > > > > // Thread #2 > > > > FATAL_ERROR: ERROR: source database "template1" is being > > > > accessed > > > > by > > > > other users > > > > DETAIL: There is 1 other session using the database. > > > > > > > I would try using dbname=postgres. > > aaaaand.... it works. Two databases have been created with return > > status "COMMAND_OK". > > > > > If you get the same error, I would say your server is in single > > > user > > > mode? > > And if you try it again using template1? > Nope, the same errors: // Thread #1 FATAL_ERROR: ERROR: source database "template1" is being accessed by other users DETAIL: There is 1 other session using the database. // Thread #2 FATAL_ERROR: ERROR: source database "template1" is being accessed by other users DETAIL: There is 1 other session using the database.