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 1kPUZp-0005bB-1U for pgsql-general@arkaria.postgresql.org; Mon, 05 Oct 2020 17:47:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPUZn-0000wC-Of for pgsql-general@arkaria.postgresql.org; Mon, 05 Oct 2020 17:47:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPUZn-0000w5-HF for pgsql-general@lists.postgresql.org; Mon, 05 Oct 2020 17:47:07 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPUZh-00069T-9B for pgsql-general@lists.postgresql.org; Mon, 05 Oct 2020 17:47:06 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 408B65C00C2; Mon, 5 Oct 2020 13:47:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 05 Oct 2020 13:47:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=r D+Q/B/P+GPzVoPLj0UCD7AolDBkwQXUexqHsWYTVb0=; b=MEzkmzb+GzpesAW+P uwymW74tU3PaU+/SoYjR6FCizBJt8rWrpxdtHo6NCHI1ISokFqV3dzHpu98mdNF8 RJuTDAWZlQ+v0M58YkLnebGz1qEDSO2nzAylyvKfa5eDbJuGJ3WOnuQN7EOpjXF8 s8BOLHPMPaaxDIRliSg8OGjZ37yGcgc5C1DFFDb5weVJbDeVpCwhxPbJ5bxVqELg hRWPUn3wqNQ+wmyDyftyOHl8/Yyr6MLszJZbAq1XXvxS3dRHBllr822yZq+TUgSq u8jToRfXK0NTVTtz1ousWNahpJZDKB8cm79sqrHDe40OBwW6znnB47Mb2avO1Uwy FPDwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=rD+Q/B/P+GPzVoPLj0UCD7AolDBkwQXUexqHsWYTV b0=; b=HPjLhAYGS/3/wH68cvOYY+wBqLj9SlZGHTFdFUVrrvJCqJV4EAcnz+0Lt EX2VSn2ijQt4/qtt7ameJgrtj/6TuasPdA5NuC54o4SWoOF2OeaDUemwd9XxMuQO HG/SbQQDZ0gbjRvp3XK+jME7FG5gJPZWsvFl6QTgaK3AT3vml32QQ7Y9Ar71j29Q 3i5Ndc0gidnmJiINhnaWNWegY0CK0tY6jrwl8u9ARLqIgCaEN7b6m0Tf4LpaY1Jz BVqBwCSo/NRQByl7Y2aES70BanwsReo+W5t3D0J7s5usZwt71IBhpDl/dLmTI6SE gXZDiAV4Sd1sKg+ibAWg81c98JdKw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgedvgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepteejvdetff ejuedvleeifeefheeutdfhgfdvhffhhfekvdduveegvdejudefgfevnecukfhppeejgedr leegrdejfedrvddvvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 46818306467D; Mon, 5 Oct 2020 13:46:59 -0400 (EDT) Subject: Re: UUID generation problem To: byrnejb@harte-lyne.ca Cc: Tom Lane , pgsql-general@lists.postgresql.org References: <271dfd309957472734a7aab8999659b1.squirrel@webmail.harte-lyne.ca> <86544317-8fa2-9193-6af2-6b6e5eab1cba@aklaver.com> <13a362eba18fbef24f8170a3e0cd8a9f.squirrel@webmail.harte-lyne.ca> <1721392.1601909600@sss.pgh.pa.us> <383e5b19-4fd5-bbf3-dd42-2e3d3c68206f@aklaver.com> <7b62b10e902e0831769f7ad5ffb37b25.squirrel@webmail.harte-lyne.ca> From: Adrian Klaver Message-ID: <70f1b155-42bf-9c66-27d2-a391842f335f@aklaver.com> Date: Mon, 5 Oct 2020 10:46:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <7b62b10e902e0831769f7ad5ffb37b25.squirrel@webmail.harte-lyne.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/5/20 9:31 AM, James B. Byrne wrote: > > > On Mon, October 5, 2020 11:52, Adrian Klaver wrote: > >> That is the natural order of events. The database has to exist before >> you can add an extension to it. Unless you are saying that you did not >> build the extension until after the database was created. >> > > That is the meaning that I meant to convey. The a rough outline of the sequent > of events respecting this was: > > Install postgreqsl > > Initialise database > > su - postgres -c 'createuser -S -d -r -l -P adempiere' > > Run install script which creates the application database. > > The install script(s) required a number of iterations and some modifications to > get working on FreeBSD. > > su idempiere -c" psql -d idempiere -U adempiere -c 'CREATE EXTENSION "uuid-ossp"' FYI, you don't need to change to a system user to use that username in the psql connection. As long as you specify -U some_name you can connect from the terminal of any system user and have the connection be from the -U some_name. > > At some point I decided to switch the name of the user owning the application > database from adempiere to idempiere-dbadmin. Probably this was done to align > the user names with our internal conventions. A decision which I strongly > suspect is at the root of this problem. > > Following this decision I went through the entire modified install scripts > again, this time using the new username(s). > However, I did discover this: > > 2000 2020-09-11 16:15:17: psql -d idempiere -U adempiere -c 'CREATE EXTENSION > "uuid-ossp"' > > 2001 2020-09-11 16:17:08: su idempiere -c" psql -d idempiere -U adempiere -c > 'CREATE EXTENSION "uuid-ossp" The thing is, from upstream: idempiere=# \df+ uuid_generate_v4 List of functions Schema | Name | Result data type | Argument data types | Type | Volatility | Parallel | Owner | Security | Access privileges | Language | Source code | Description --------+------------------+------------------+---------------------+------+------------+----------+----------+----------+-------------------+----------+------------------+------------- public | uuid_generate_v4 | uuid | | func | volatile | safe | postgres | invoker | | c | uuid_generate_v4 | (1 row) This indicates that you created the extension as user 'postgres'. > > I can only conjecture that I got confused at this point in the process and used > the admpiere username artifact from the initial install attempts instead of the > idempiere-admin username subsequently employed. > > I realise that I am providing this information in a rather disjointed manner. > However the number of modifications and restarts I had to perform to get the > software to install rather confuses my memory and the history logs do not add > much in the way of clarity. > > What I need to know now is how to correct this error. It would depend on whether the database is live or not. If it is still in dev stage I would say start over with install, using the new found knowledge. Otherwise it will depend on the answers to the questions downstream. Will answer there. > > -- Adrian Klaver adrian.klaver@aklaver.com