ECPG sqlca error handling

2020-11-11 Thread Matthias Apitz
Hello, The documentation explains well how to use the 'sqlca' for error handling: https://www.postgresql.org/docs/13/ecpg-errors.html#ECPG-SQLCA An error message is stored in sqlca.sqlerrm.char sqlerrmc[SQLERRMC_LEN]. My question is: Is there some way to get the exact failing ESQL/C statement,

Re: Encryption with customer provided key in a multi tenant Postgres JSONB DB

2020-11-11 Thread Saurav Sarkar
Hi David, Thanks for the reply. I just wanted to check if there is any possibility or any activity ongoing which can enable database or fine granular level encryption in future. Probably then i can wait otherwise i have to move towards Client Side encryption as you mentioned. Best Regards, Saur

Re: Discovering postgres binary directory location

2020-11-11 Thread Paul Förster
Hi Raul, hi Adrian, > On 11. Nov, 2020, at 23:26, Adrian Klaver wrote: > > On 11/11/20 2:22 PM, Raul Kaubi wrote: >> Hi >> CentOS 7 >> Postgres 9 to 12 >> I am looking ways to universally discover postgresql binary directory for >> monitoring purpose. >> For example postgres 12, it is: */usr/pg

Re: Need to place pgpool logs on separate directory

2020-11-11 Thread Tatsuo Ishii
> Thanks Tatsuo for the info. I will contact pgpool forum regarding this. > > Also I tried restarting and reloading the pgpool service after each of the > above parameter changes, still it's not working. > > > item | value >

Re: Encryption with customer provided key in a multi tenant Postgres JSONB DB

2020-11-11 Thread David G. Johnston
On Wed, Nov 11, 2020 at 10:49 PM Saurav Sarkar wrote: > We have a multi tenant application where for each tenant we create > separate tables . So for e.g. if i have 100 tenants then i have 100 tables. > > Now we want to have encryption for the data in the tables with the tenant > provided key. Is

Encryption with customer provided key in a multi tenant Postgres JSONB DB

2020-11-11 Thread Saurav Sarkar
Hi All, We use Postgres's JSONB structure for NoSQL usage. We have a multi tenant application where for each tenant we create separate tables . So for e.g. if i have 100 tenants then i have 100 tables. Now we want to have encryption for the data in the tables with the tenant provided key. Is it

Re: Need to place pgpool logs on separate directory

2020-11-11 Thread RAJAMOHAN
Thanks Tatsuo for the info. I will contact pgpool forum regarding this. Also I tried restarting and reloading the pgpool service after each of the above parameter changes, still it's not working. item | value

Re: Need to place pgpool logs on separate directory

2020-11-11 Thread Tatsuo Ishii
> Hello all, > > I want to place pgpool logs on a separate directory rather than in a syslog > file. So I changed the below parameters, but still logging information are > being written to the syslog file. Any idea or suggestion why this > behaviour? > > > > *pgpool-II version 4.1.4 (karasukib

Re: identify partitioning columns and best practices of partitioning in prod enviornments

2020-11-11 Thread Michael Lewis
On Wed, Nov 11, 2020 at 3:58 PM Ron wrote: > On 11/11/20 4:31 PM, Atul Kumar wrote: > > Hi, > > > > I want to about best practices of partitioning in prod environments > > and how to identify partitioning columns. > > It depends on what you want to do. If your purpose is to simplify the > deleti

Re: identify partitioning columns and best practices of partitioning in prod enviornments

2020-11-11 Thread Ron
On 11/11/20 4:31 PM, Atul Kumar wrote: Hi, I want to about best practices of partitioning in prod environments and how to identify partitioning columns. It depends on what you want to do.  If your purpose is to simplify the deletion of old records, then partition by an unchanging date field.

identify partitioning columns and best practices of partitioning in prod enviornments

2020-11-11 Thread Atul Kumar
Hi, I want to about best practices of partitioning in prod environments and how to identify partitioning columns. Regards, Atul

Re: Discovering postgres binary directory location

2020-11-11 Thread Adrian Klaver
On 11/11/20 2:22 PM, Raul Kaubi wrote: Hi CentOS 7 Postgres 9 to 12 I am looking ways to universally discover postgresql binary directory for monitoring purpose. For example postgres 12, it is: */usr/pgsql-12* pg_config --bindir /usr/local/pgsql12/bin So what would be the best way to dis

Discovering postgres binary directory location

2020-11-11 Thread Raul Kaubi
Hi CentOS 7 Postgres 9 to 12 I am looking ways to universally discover postgresql binary directory for monitoring purpose. For example postgres 12, it is: */usr/pgsql-12* So what would be the best way to discover this in specific host. Regards Raul

Re: New "function tables" in V13 documentation

2020-11-11 Thread Bruce Momjian
On Mon, Nov 9, 2020 at 07:46:21PM -0600, Merlin Moncure wrote: > On Sun, Nov 8, 2020 at 3:57 PM Thomas Kellerer wrote: > > > > In case someone is interested: there is a little discussion going on on > > Reddit whether the new format of presenting functions in V13 is a step > > backwards: > > >

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Jitendra Loyal
Thanks Laurenz This is interesting...b is True Thanks and regards, Jitendra On Wed 11 Nov, 2020, 22:52 Laurenz Albe, wrote: > On Wed, 2020-11-11 at 11:47 +0100, Tomas Vondra wrote: > > you may do this, for example: > > > > (b it not null and b = true) and (c is not null) > > > > Or somethi

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Laurenz Albe
On Wed, 2020-11-11 at 11:47 +0100, Tomas Vondra wrote: > you may do this, for example: > > (b it not null and b = true) and (c is not null) > > Or something like that. My (equivalent) suggestion: b IS TRUE AND c IS NOT NULL Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgre

Re: Execution plan does not use index

2020-11-11 Thread Peter Coppens
> Good luck! Tx! And tx for your support.

Re: Execution plan does not use index

2020-11-11 Thread Michael Lewis
On Wed, Nov 11, 2020, 7:30 AM Peter Coppens wrote: > > > It seems odd to me to not do any basic adjustment of random_page_cost > though. It isn't a magic number that the core team know to be perfect. It > is a baseline that is likely to be quite different for each use case and > server config. Wh

Re: database aliasing options ?

2020-11-11 Thread Peter J. Holzer
On 2020-11-09 10:49:52 -0500, Tom Lane wrote: > David Gauthier writes: > > Our IT dept has configured our PG DB as a "High Availability" database. It > > has a primary and backup server (disks too). Normally both are running but > > if one goes down, the other is still available for use, effecti

Re: Execution plan does not use index

2020-11-11 Thread Peter Coppens
> > Ahhh. You don't have a single column index on the timestamp value or a multi > column one with timestamp first. No wonder the subquery didn't help. My > apologies for not realizing that before. Thanks for satisfying my curiosity > why it didn't perform like it should. Certainly, that index

Re: Execution plan does not use index

2020-11-11 Thread Michael Lewis
On Tue, Nov 10, 2020, 10:51 PM Peter Coppens wrote: > If you disable sequential scan, does it choose the index and what cost > does it show? > > > It chooses the index, but apparently to create some intermediate structure > that then later still needs to be joined on the device_id. Probably > req

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Jitendra Loyal
Thanks Tomas Understood... My bad Was just not looking at that aspect Thanks once again, Regards, Jitendra On Wed, 11 Nov 2020 at 16:17, Tomas Vondra wrote: > > On 11/11/20 10:06 AM, Jitendra Loyal wrote: > > Thanks Nikolay > > > > I read that but is there a way to meet the above requ

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Tomas Vondra
On 11/11/20 10:06 AM, Jitendra Loyal wrote: > Thanks Nikolay > > I read that but is there a way to meet the above requirement. And I will > like to add that IS NULL and IS NOT NULL should evaluate to true/false. > These operators are made for this and should not be returning NULL. > This has n

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Alban Hertroys
On 11 Nov 2020, at 11:15, Jitendra Loyal wrote: > >  > Thanks Nikolay > > I read that but is there a way to meet the above requirement. And I will like > to add that IS NULL and IS NOT NULL should evaluate to true/false. These > operators are made for this and should not be returning NULL.

Need to place pgpool logs on separate directory

2020-11-11 Thread RAJAMOHAN
Hello all, I want to place pgpool logs on a separate directory rather than in a syslog file. So I changed the below parameters, but still logging information are being written to the syslog file. Any idea or suggestion why this behaviour? *pgpool-II version 4.1.4 (karasukiboshi)* Tried all th

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Jitendra Loyal
Thanks Nikolay I read that but is there a way to meet the above requirement. And I will like to add that IS NULL and IS NOT NULL should evaluate to true/false. These operators are made for this and should not be returning NULL. Regards, Jitendra On Wed 11 Nov, 2020, 14:18 Nikolay Samokhvalov, w

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Nikolay Samokhvalov
On Wed, Nov 11, 2020 at 12:26 AM Jitendra Loyal wrote: > Despite the above two constraints, the following rows get into the table: > insert into t (b , c) values (null, true), (null, false); > This behavior is described in the docs https://www.postgresql.org/docs/current/ddl-constraints.htm

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Pavel Stehule
st 11. 11. 2020 v 9:38 odesílatel Chris Sterritt napsal: > > On 11/11/2020 06:44, Jitendra Loyal wrote: > > Consider this table definition: > create table t ( i serial, b bool, c bool, > constraint b_c check ( (b = true and c is > not null ) or (b is disti

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Chris Sterritt
On 11/11/2020 06:44, Jitendra Loyal wrote: Consider this table definition:  create table t ( i serial, b bool, c bool,                       constraint b_c check ( (b = true and c is not null ) or (b is distinct from true and c is null) )                       constraint b_c check ( (b = true

Check constraints do not seem to be working!!!

2020-11-11 Thread Jitendra Loyal
Consider this table definition: create table t ( i serial, b bool, c bool, constraint b_c check ( (b = true and c is not null ) or (b is distinct from true and c is null) ) constraint b_c check ( (b = true and c is not null )