Re: UUID generation problem

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: byrnejb(at)harte-lyne(dot)ca
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: UUID generation problem
Date: 2020-10-05 16:08:07
Message-ID: 8bbfffec-a084-88bf-b4dc-bbfadfd21df6@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/5/20 8:57 AM, James B. Byrne wrote:
>
>
> On Mon, October 5, 2020 11:15, Adrian Klaver wrote:
>>
>> Per Tom's post this does not make sense.
>>
>> What if you connect doing?:
>>
>> psql --dbname=idempiere --username=idempiere_dbadmin
>>
>> And specify the port(-p)
>>
>> Cut out the sudo.
>>
>>
>> Then do:
>>
>> select current_schemas(true);
>>
>> select uuid_generate_v4();
>>
>> select public.uuid_generate_v4();
>>
>
> [root(at)accounting-2 ~ (master)]# psql --dbname=idempiere
> --username=idempiere_dbadmin
> Password for user idempiere_dbadmin:
> psql (11.8)
> Type "help" for help.
>
> idempiere=# select current_schemas(true);
> current_schemas
> ------------------------
> {adempiere,pg_catalog}

Well there is your problem. That is a different search_path and it does
not include the 'public' schema. This would indicate you are connecting
to a different instance of Postgres then in your previous example. I'm
going to bet you are connecting to different ports. I use the following
in my .psqlrc(local psql conf file):

\set PROMPT1 '%/%R%# '

to get the database name and port. I would try that at least
temporarily(at psql prompt) to sort out what/where you are connecting to.

> (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
> --------------------------------------
> 066e3298-3c91-4079-98ee-2b279bfc4025
> (1 row)
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-10-05 16:12:30 Re: UUID generation problem
Previous Message Tom Lane 2020-10-05 16:06:56 Re: UUID generation problem