Re: Error message

2021-03-15 Thread Igor Korot
Thx, David. I need to get some sleep. ;-) On Tue, Mar 16, 2021 at 12:35 AM David G. Johnston wrote: > > On Monday, March 15, 2021, Igor Korot wrote: >> >> [quote] >> As with PQexec, the result is normally a PGresult object whose >> contents indicate server-side success or failure. A null resul

Re: Error message

2021-03-15 Thread David G. Johnston
On Monday, March 15, 2021, Igor Korot wrote: > > [quote] > As with PQexec, the result is normally a PGresult object whose > contents indicate server-side success or failure. A null result > indicates out-of-memory or inability to send the command at all. Use > PQerrorMessage to get more informatio

Error message

2021-03-15 Thread Igor Korot
Hi, ALL, Documentation for PQprepare states: [quote] As with PQexec, the result is normally a PGresult object whose contents indicate server-side success or failure. A null result indicates out-of-memory or inability to send the command at all. Use PQerrorMessage to get more information about suc

Re: Fwd: row level security (RLS)

2021-03-15 Thread Rafal Pietrak
W dniu 15.03.2021 o 18:01, Laurenz Albe pisze: > On Mon, 2021-03-15 at 16:28 +0100, Rafal Pietrak wrote: >> 5. My experiments with RLS was like following: >> - I've implemented a STABLE function, that returns INTEGER 1/0 >> - I've linked that function as POLICY to my tables >>

Re: sql3types.h does not include "BigInt"

2021-03-15 Thread Tom Lane
Niko Ware writes: > The data types defined in sql3types.h (see below) do not include "zero" or > "bigint" (the enumerated values start at "1"). Hm. It looks like that header hasn't been touched since around SQL99 (which did not have bigint). Current versions of the spec list bigint as code 25 (

Re: Allowing John to Drop Triggers On Chad's Tables

2021-03-15 Thread Tom Lane
Fred Habash writes: > Based on my research, There are the options I have identified to allow user > 'John' to drop a trigger on a table owner by 'Chad' .. I guess the big-picture question is why do you think you need that? The separate TRIGGER permission is something we consider obsolescent. It'

sql3types.h does not include "BigInt"

2021-03-15 Thread Niko Ware
I'm using "dynamic sql" to process generic queries (see code fragment below). The routine works correctly for most data types, but it does not work for functions (e.g., NextVal()). The data TYPE returned for NextVal() sequence is zero (see line 24 of the code fragment). The documented data type for

Re: Allowing John to Drop Triggers On Chad's Tables

2021-03-15 Thread David G. Johnston
On Mon, Mar 15, 2021 at 12:20 PM Fred Habash wrote: > If there is a 'grant trigger' why is there not a 'grant drop trigger'? > > Because creating a trigger from scratch doesn't let you affect other triggers that you may not own (at least not directly). If drop permissions were grantable the user

Fwd: row level security (RLS)

2021-03-15 Thread Rafal Pietrak
Hello, I was told, that pgsql-hackers is not the right list for the following questions. So I'm reposting to general. Does anybody have an opinion regarding the following questions? --- Hello, Forgive me for probably naive questions, being so talkative like the foll

Allowing John to Drop Triggers On Chad's Tables

2021-03-15 Thread Fred Habash
Based on my research, There are the options I have identified to allow user 'John' to drop a trigger on a table owner by 'Chad' .. 1. Make John a superuser 2. grant chad to john ; 3. Have Chad create a wrapper definer-rights procedure to drop triggers & grant execute to John. 4. Give John Chad's p

Re: Fwd: row level security (RLS)

2021-03-15 Thread Laurenz Albe
On Mon, 2021-03-15 at 16:28 +0100, Rafal Pietrak wrote: > 5. My experiments with RLS was like following: > - I've implemented a STABLE function, that returns INTEGER 1/0 > - I've linked that function as POLICY to my tables > - I've GRANTED PUBLIC access to those tables >

Postgres vacuum taking gitlab down ???

2021-03-15 Thread RaviKrishna
check the details here: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/3962 I noticed it when my git push was timing out. -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Re: Need help on understanding of wal_keep-segments and max_wal_size dependency.

2021-03-15 Thread Laurenz Albe
On Mon, 2021-03-15 at 10:00 +, Swati yadav wrote: > We are using streaming replication without feature archiving and replication > slots. > > Could you please help us in understanding how replication will works > when I set max_wal_size to 1GB, wal_keep_segments set to 300. > > In this scen

Re: Refcursor

2021-03-15 Thread Laurenz Albe
On Mon, 2021-03-15 at 13:58 +0200, Yambu wrote: > May I know why the below takes so long? > > > BEGIN; > select * from func1() ; > fetch all from ""; > end; > > Select * from func1() ; on its own is very fast The second just fetches a cursor for the query, the first executes the query.

Re: Postgres crashes at memcopy() after upgrade to PG 13.

2021-03-15 Thread Avinash Kumar
Hi Thomas, On Sun, Mar 14, 2021 at 10:01 PM Avinash Kumar wrote: > Hi Thomas, > > On Sun, Mar 14, 2021 at 9:40 PM Thomas Munro > wrote: > >> On Mon, Mar 15, 2021 at 1:29 PM Avinash Kumar >> wrote: >> > Is this expected when replication is happening between PostgreSQL >> databases hosted on dif

Re: Postgres crashes at memcopy() after upgrade to PG 13.

2021-03-15 Thread Avinash Kumar
Hi Thomas, On Sun, Mar 14, 2021 at 9:40 PM Thomas Munro wrote: > On Mon, Mar 15, 2021 at 1:29 PM Avinash Kumar > wrote: > > Is this expected when replication is happening between PostgreSQL > databases hosted on different OS versions like Ubuntu 16 and Ubuntu 20 ? > Or, do we think this is some

Re: Postgres crashes at memcopy() after upgrade to PG 13.

2021-03-15 Thread Thomas Munro
On Mon, Mar 15, 2021 at 1:29 PM Avinash Kumar wrote: > Is this expected when replication is happening between PostgreSQL databases > hosted on different OS versions like Ubuntu 16 and Ubuntu 20 ? Or, do we > think this is some sort of corruption ? Is this index on a text datatype, and using a c

Refcursor

2021-03-15 Thread Yambu
Hi I new to cursors May I know why the below takes so long? BEGIN; select * from func1() ; fetch all from ""; end; Select * from func1() ; on its own is very fast

Need help on understanding of wal_keep-segments and max_wal_size dependency.

2021-03-15 Thread Swati yadav
Hello Team We are using streaming replication without feature archiving and replication slots. Could you please help us in understanding how replication will works when I set max_wal_size to 1GB, wal_keep_segments set to 300?. ?In this scenario, replication is getting failed. Could you pl