From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Sasmit Utkarsh <utkarshsasmit@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Postgresql assistance needed
Date: Thu, 22 Feb 2024 14:41:45 +0100
Message-ID: <0645e22e8431aa73b7e0a0037d79295b9cae0e84.camel@cybertec.at> (raw)
In-Reply-To: <CAM-5MT0aPKb6uSXR-ecsqkYPjWwKXgqshEORV0ysgN2tigtQ+w@mail.gmail.com>
References: <CAM-5MT3pqu+3xV6syK8wRF7HYCE9F_Z5U4Rwi7F+OHfDcfXeWQ@mail.gmail.com>
<19a809d477baef0cd9414d8d504705cf268ece52.camel@cybertec.at>
<CAM-5MT33-RMk+p7RLaH+VH3AZNKpZVZCFVbk=q-F7McqHu89AA@mail.gmail.com>
<1ee85442d6b0411cd4846e61449cfe85d0f87a30.camel@cybertec.at>
<CAM-5MT0aPKb6uSXR-ecsqkYPjWwKXgqshEORV0ysgN2tigtQ+w@mail.gmail.com>
On Thu, 2024-02-22 at 17:18 +0530, Sasmit Utkarsh wrote:
> Perhaps, the issue I wanted to highlight here is that I get the same entry working
> when I switch user to "pgddb_admin" and not when change user with same privileges
> as PGUSER "shc_uadmin" I get the message in the error log like
> "<3>3343433-[ERROR] SELECT nextval Failed [../tpfasm.c:3561:get_pool_fa]"
> even though i see the next val from db. Please see below when logged in to the db
> and snippet of the code lines where it was throwing the error.
>
> [shc_user@cucmtpccu1 ~]$ psql "host= cucmpsgsu0.postgres.database.azure.com port=5432 dbname=mshcd user=shc_uadmin password=abc123 sslmode=require options=--search_path=shc,public"
> psql (16.1, server 15.4)
> SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
> Type "help" for help.
> mshcd=> SELECT nextval('unassigned_pool_fa');
> nextval
> -------------
> -1811939322
> (1 row)
>
>
> code snippet:
> 3555 } else {
> 3556 LOG_WARN("No File_address is found with status=free");
> 3557 //If no free address is found, get the next value available address from the sequence
> 3558 PQclear(res);
> 3559 res = PQexec(conn, "SELECT nextval('unassigned_pool_fa');");
> 3560 if (PQresultStatus(res) != PGRES_TUPLES_OK) {
> 3561 LOG_ERROR("SELECT nextval Failed");
> 3562 LOG_DEBUG("ROLLBACK TRANSACTION");
> 3563 res = PQexec(conn,"ROLLBACK TRANSACTION");
> 3564 PQclear(res);
> 3565 return 0;
> 3566 }
To debug that, get the actual error message using PQerrorMessage().
That should tell you what is going on.
Perhaps the sequence is not on your "search_path", and you should
qualify the name with the schema.
Yours,
Laurenz Albe
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: laurenz.albe@cybertec.at, utkarshsasmit@gmail.com
Subject: Re: Postgresql assistance needed
In-Reply-To: <0645e22e8431aa73b7e0a0037d79295b9cae0e84.camel@cybertec.at>
References: <CAM-5MT3pqu+3xV6syK8wRF7HYCE9F_Z5U4Rwi7F+OHfDcfXeWQ@mail.gmail.com> <19a809d477baef0cd9414d8d504705cf268ece52.camel@cybertec.at> <CAM-5MT33-RMk+p7RLaH+VH3AZNKpZVZCFVbk=q-F7McqHu89AA@mail.gmail.com> <1ee85442d6b0411cd4846e61449cfe85d0f87a30.camel@cybertec.at> <CAM-5MT0aPKb6uSXR-ecsqkYPjWwKXgqshEORV0ysgN2tigtQ+w@mail.gmail.com> <0645e22e8431aa73b7e0a0037d79295b9cae0e84.camel@cybertec.at>
* 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