pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: byrnejb@harte-lyne.ca
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: UUID generation problem
Date: Mon, 5 Oct 2020 12:20:02 -0700
Message-ID: <9653ebb5-98cc-b318-335d-babd7a62ce70@aklaver.com> (raw)
In-Reply-To: <14597a6a35fe09a349fb56098ed4c5db.squirrel@webmail.harte-lyne.ca>
References: <271dfd309957472734a7aab8999659b1.squirrel@webmail.harte-lyne.ca>
	<86544317-8fa2-9193-6af2-6b6e5eab1cba@aklaver.com>
	<d4d8c3b2def5f1cb33bffe21a7085811.squirrel@webmail.harte-lyne.ca>
	<dfc4a83f-c227-684c-c841-e2fa7069bd4b@aklaver.com>
	<13a362eba18fbef24f8170a3e0cd8a9f.squirrel@webmail.harte-lyne.ca>
	<1721392.1601909600@sss.pgh.pa.us>
	<afb165220d3b3404aebaae979fdaeed2.squirrel@webmail.harte-lyne.ca>
	<383e5b19-4fd5-bbf3-dd42-2e3d3c68206f@aklaver.com>
	<7b62b10e902e0831769f7ad5ffb37b25.squirrel@webmail.harte-lyne.ca>
	<70f1b155-42bf-9c66-27d2-a391842f335f@aklaver.com>
	<14597a6a35fe09a349fb56098ed4c5db.squirrel@webmail.harte-lyne.ca>

On 10/5/20 12:09 PM, James B. Byrne wrote:
> 
> 
> On Mon, October 5, 2020 13:46, Adrian Klaver wrote:
>> 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'.
>>
> 
> Why would I not use the postgres user to create an extension?
> 

The uuid-extension needs to be installed by a super user:

test(5432)=> select current_user;
  current_user
--------------
  aklaver


test(5432)=> create extension "uuid-ossp" ;
ERROR:  permission denied to create extension "uuid-ossp"
HINT:  Must be superuser to create this extension.

test(5432)=> \c - postgres
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, 
bits: 256, compression: off)
You are now connected to database "test" as user "postgres".
test(5432)=# create extension "uuid-ossp" ;
CREATE EXTENSION

So postgres is probably as good as any.

I was just pointing out that what you posted earlier:

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"


does not match what you showed for the actual installed code:


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 |

NOTE: Owner = postgres.



-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (53+ messages)  latest in thread

Message-ID: <9653ebb5-98cc-b318-335d-babd7a62ce70@aklaver.com>
Permalink:  ../9653ebb5-98cc-b318-335d-babd7a62ce70@aklaver.com/
Also on:    postgresql.org/message-id/9653ebb5-98cc-b318-335d-babd7a62ce70@aklaver.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, byrnejb@harte-lyne.ca, tgl@sss.pgh.pa.us
  Subject: Re: UUID generation problem
  In-Reply-To: <9653ebb5-98cc-b318-335d-babd7a62ce70@aklaver.com>
  References: <271dfd309957472734a7aab8999659b1.squirrel@webmail.harte-lyne.ca> <86544317-8fa2-9193-6af2-6b6e5eab1cba@aklaver.com> <d4d8c3b2def5f1cb33bffe21a7085811.squirrel@webmail.harte-lyne.ca> <dfc4a83f-c227-684c-c841-e2fa7069bd4b@aklaver.com> <13a362eba18fbef24f8170a3e0cd8a9f.squirrel@webmail.harte-lyne.ca> <1721392.1601909600@sss.pgh.pa.us> <afb165220d3b3404aebaae979fdaeed2.squirrel@webmail.harte-lyne.ca> <383e5b19-4fd5-bbf3-dd42-2e3d3c68206f@aklaver.com> <7b62b10e902e0831769f7ad5ffb37b25.squirrel@webmail.harte-lyne.ca> <70f1b155-42bf-9c66-27d2-a391842f335f@aklaver.com> <14597a6a35fe09a349fb56098ed4c5db.squirrel@webmail.harte-lyne.ca> <9653ebb5-98cc-b318-335d-babd7a62ce70@aklaver.com>

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

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