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, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: UUID generation problem
Date: Mon, 5 Oct 2020 10:24:04 -0700
Message-ID: <cb082ecb-56f2-7e3d-90db-4680470ecaea@aklaver.com> (raw)
In-Reply-To: <403a14de3dc784c868813d275b938866.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>
	<1732745.1601914016@sss.pgh.pa.us>
	<b1e2554490a1919e2213d85fc57799cd.squirrel@webmail.harte-lyne.ca>
	<1778495.1601916688@sss.pgh.pa.us>
	<403a14de3dc784c868813d275b938866.squirrel@webmail.harte-lyne.ca>

On 10/5/20 9:59 AM, James B. Byrne wrote:
> 
> 
> On Mon, October 5, 2020 12:51, Tom Lane wrote:
>> "James B. Byrne" <byrnejb@harte-lyne.ca> writes:
>>> [root@accounting-2 ~ (master)]#  psql --dbname=idempiere
>>> --username=idempiere_dbadmin --host=localhost
>>> Password for user idempiere_dbadmin:
>>> psql (11.8)
>>> Type "help" for help.
>>
>>> idempiere=# select current_schemas(true);
>>>      current_schemas
>>> ------------------------
>>>   {adempiere,pg_catalog}
>>> (1 row)
>>
>>> idempiere=# select uuid_generate_v4();
>>> ERROR:  function uuid_generate_v4() does not exist
>>> LINE 1: select uuid_generate_v4();
>>>                 ^
>>> HINT:  No function matches the given name and argument types. You might need
>>> to
>>> add explicit type casts.
>>> idempiere=# select public.uuid_generate_v4();
>>>             uuid_generate_v4
>>> --------------------------------------
>>>   5ba19b69-ec8e-4d8e-8968-7c84eccc4351
>>> (1 row)
>>
>> Well, at least here we have consistent results: "public" is not in
>> your search_path.  (Presumably, "show search_path" would confirm
>> that.)  The question is what did you do differently before that
>> led to the other current_schemas result?  If the *only* difference
>> is whether you use --host=localhost or not, it's hard to conclude
>> anything but that you're connecting to two different databases.
>> I don't quite see how that could be, with only one postmaster on
>> the machine, but maybe it's time to wonder about rogue connection
>> poolers or the like.
> 
> specifying the connection host does not change the observed behaviours.
> 
>>
>> It might be worth poking into the pg_db_role_setting catalog,
>> which is the most likely source of a different search_path for
>> different connections.
> 
> It seems so:
> 
> idempiere=# SELECT * FROM pg_db_role_setting;
>   setdatabase | setrole |               setconfig
> -------------+---------+---------------------------------------
>             0 |   21328 | {"search_path=adempiere, pg_catalog"}

To confirm what role this is assigned to do:

select rolname from pg_authid where oid = 21328;

> (1 row)
> 
>>
>> Another line of thought is maybe you have a ~/.psqlrc that's
>> altering the search_path setting.
>>
> 
> Up until 5 minutes ago I did not have a ~/.psqlrc file.  And there is no system
> psqlrc file.
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (53+ messages)  latest in thread

Message-ID: <cb082ecb-56f2-7e3d-90db-4680470ecaea@aklaver.com>
Permalink:  ../cb082ecb-56f2-7e3d-90db-4680470ecaea@aklaver.com/
Also on:    postgresql.org/message-id/cb082ecb-56f2-7e3d-90db-4680470ecaea@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, tgl@sss.pgh.pa.us
  Subject: Re: UUID generation problem
  In-Reply-To: <cb082ecb-56f2-7e3d-90db-4680470ecaea@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> <1732745.1601914016@sss.pgh.pa.us> <b1e2554490a1919e2213d85fc57799cd.squirrel@webmail.harte-lyne.ca> <1778495.1601916688@sss.pgh.pa.us> <403a14de3dc784c868813d275b938866.squirrel@webmail.harte-lyne.ca> <cb082ecb-56f2-7e3d-90db-4680470ecaea@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