Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Edoardo Panfili
> Il giorno 21 ago 2023, alle ore 21:37, Dave Cramer > ha scritto: > > > > On Mon, 21 Aug 2023 at 14:42, Edoardo Panfili > wrote: >> >> >> > Il giorno 21 ago 2023, alle ore 20:13, Peter J. Holzer > > > ha scritto: >> > >> > On 2023-08-

Re: Will PostgreSQL 16 supports native transparent data encryption ?

2023-08-21 Thread Andreas Kretschmer
On 22 August 2023 06:52:10 CEST, Ron wrote: >On 8/21/23 18:49, Bruce Momjian wrote: >> On Mon, Aug 21, 2023 at 07:02:46PM +0300, Mostafa Fathy wrote: >>> Hi there, >>> >>> It is mentioned here https://www.postgresql.org/about/press/faq/#:~:text= >>> Q%3A%20What%20features%20will%20PostgreSQL%2

Re: EXPLAIN statement can also apply to SELECT INTO.

2023-08-21 Thread David G. Johnston
On Monday, August 21, 2023, jian he wrote: > hi. > > https://www.postgresql.org/docs/current/sql-explain.html > >>> > Any SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, > CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS statement, whose > execution plan you wish to see. > >>> > >

EXPLAIN statement can also apply to SELECT INTO.

2023-08-21 Thread jian he
hi. https://www.postgresql.org/docs/current/sql-explain.html >>> Any SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS statement, whose execution plan you wish to see. >>> seems you can use it with SELECT INTO. explain (ANALYZE, BUFF

Re: Will PostgreSQL 16 supports native transparent data encryption ?

2023-08-21 Thread Ron
On 8/21/23 18:49, Bruce Momjian wrote: On Mon, Aug 21, 2023 at 07:02:46PM +0300, Mostafa Fathy wrote: Hi there, It is mentioned here https://www.postgresql.org/about/press/faq/#:~:text= Q%3A%20What%20features%20will%20PostgreSQL%2016%20have%3F that native transparent data encryption is being wo

Re: Will PostgreSQL 16 supports native transparent data encryption ?

2023-08-21 Thread Bruce Momjian
On Mon, Aug 21, 2023 at 07:02:46PM +0300, Mostafa Fathy wrote: > Hi there, > > It is mentioned here https://www.postgresql.org/about/press/faq/#:~:text= > Q%3A%20What%20features%20will%20PostgreSQL%2016%20have%3F that native > transparent data encryption is being worked on and it may be delivered

Re: JDBC + PG-15 but not psql

2023-08-21 Thread Amn Ojee Uw
Thanks Dave for your interest. In  the OP I started by explaining the difficulties when trying to create a tabelspace using JDBC; please note that when using the PG-15 prompt I did not have the problem. Well, it turns out that while developing the request for help (writing the email), I realiz

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Peter J. Holzer
On 2023-08-21 17:31:06 -0400, Dave Cramer wrote: > On Mon, 21 Aug 2023 at 17:17, Ron wrote: > > On 8/21/23 14:32, Dave Cramer wrote: > > [snip] > > It has to do with the way the data is being transferred. When the > driver switches to a named statement it also switches t

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Dave Cramer
On Mon, 21 Aug 2023 at 17:17, Ron wrote: > On 8/21/23 14:32, Dave Cramer wrote: > > [snip] > > It has to do with the way the data is being transferred. When the driver > switches to a named statement it also switches to binary mode which means > data will be transferred in binary. > > In text we

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Ron
On 8/21/23 14:32, Dave Cramer wrote: [snip] It has to do with the way the data is being transferred. When the driver switches to a named statement it also switches to binary mode which means data will be transferred in binary. In text we get -1, in binary we get -1.0 That seems odd.  Why doe

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Dave Cramer
On Mon, 21 Aug 2023 at 14:42, Edoardo Panfili wrote: > > > > Il giorno 21 ago 2023, alle ore 20:13, Peter J. Holzer > ha scritto: > > > > On 2023-08-21 17:27:20 +0200, Edoardo Panfili wrote: > >> The attended result was a sequence of ten equal values but this is the > actual result: > >> p: -1 >

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Dave Cramer
On Mon, 21 Aug 2023 at 15:12, Edoardo Panfili < edoardo.panf...@iisgubbio.edu.it> wrote: > > > Il giorno 21 ago 2023, alle ore 17:45, Adrian Klaver < > adrian.kla...@aklaver.com> ha scritto: > > On 8/21/23 08:27, Edoardo Panfili wrote: > > Hello, > I am using > postgresql version: 15.3 (Debian 15.

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Dave Cramer
On Mon, 21 Aug 2023 at 12:46, Tom Lane wrote: > "David G. Johnston" writes: > > Otherwise, I agree this seems like a bug, probably in the JDBC driver, > > though one pertains to style as opposed to semantics since both answers > are > > technically correct. > > I don't see any such behavior chan

Re: JDBC + PG-15 but not psql

2023-08-21 Thread Dave Cramer
Hi Amn, Can you help me understand this issue better? I don't see anywhere in the code where you are attempting to create a tablespace ? Dave Cramer On Sun, 20 Aug 2023 at 11:17, Amn Ojee Uw wrote: > Hello. > > I have searched the net in an attempt to find if others have had and > resolved

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Edoardo Panfili
> Il giorno 21 ago 2023, alle ore 20:13, Peter J. Holzer ha > scritto: > > On 2023-08-21 17:27:20 +0200, Edoardo Panfili wrote: >> The attended result was a sequence of ten equal values but this is the >> actual result: >> p: -1 >> p: -1 >> p: -1 >> p: -1 >> p: -1 >> p: -1.0 >> p: -1.0 >> p:

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Peter J. Holzer
On 2023-08-21 17:27:20 +0200, Edoardo Panfili wrote: > The attended result was a sequence of ten equal values but this is the actual > result: > p: -1 > p: -1 > p: -1 > p: -1 > p: -1 > p: -1.0 > p: -1.0 > p: -1.0 > p: -1.0 > p: -1.0 [...] > 2023-08-21 11:51:50.633 CEST [1511] user@testdb LOG: exec

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Rob Sargent
On 8/21/23 11:17, Edoardo Panfili wrote: Use the type appropriate getter, not getString, to retrieve the value of the underlying real typed column. I know, but in this occasion I need to use text value. Otherwise, I agree this seems like a bug, probably in the JDBC driver, though one pertain

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Pavel Stehule
po 21. 8. 2023 v 19:52 odesílatel Edoardo Panfili < edoardo.panf...@iisgubbio.edu.it> napsal: > > > > Il giorno 21 ago 2023, alle ore 18:45, Tom Lane ha > scritto: > > > > "David G. Johnston" writes: > >> Otherwise, I agree this seems like a bug, probably in the JDBC driver, > >> though one pert

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Edoardo Panfili
> Il giorno 21 ago 2023, alle ore 18:45, Tom Lane ha > scritto: > > "David G. Johnston" writes: >> Otherwise, I agree this seems like a bug, probably in the JDBC driver, >> though one pertains to style as opposed to semantics since both answers are >> technically correct. > > I don't see an

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Edoardo Panfili
> Il giorno 21 ago 2023, alle ore 17:50, David G. Johnston > ha scritto: > > > On Mon, Aug 21, 2023 at 8:28 AM Edoardo Panfili > mailto:edoardo.panf...@iisgubbio.edu.it>> > wrote: >> >>dim1 real DEFAULT '-1' NOT NULL >> >> System.out.print("p: "+rs.getString("dim1")+"\n”); >> >>

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Edoardo Panfili
> Il giorno 21 ago 2023, alle ore 17:45, Adrian Klaver > ha scritto: > > On 8/21/23 08:27, Edoardo Panfili wrote: >> Hello, >> I am using >> postgresql version: 15.3 (Debian 15.3-0+deb12u1) >> org.postgresql.postgresql JDBC driver version: 42.6.0 >> via Java 17.0.7 >> I discovered an unattende

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Adrian Klaver
On 8/21/23 09:31, Rihad wrote: On 8/21/23 20:17, Adrian Klaver wrote: On 8/21/23 09:09, Rihad wrote: On 8/21/23 20:00, Adrian Klaver wrote: Sorry, they are all as per default, commented out in the config. There are no long running queries, otherwise they wouldn't be vacuumed/analyzed in

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Tom Lane
"David G. Johnston" writes: > Otherwise, I agree this seems like a bug, probably in the JDBC driver, > though one pertains to style as opposed to semantics since both answers are > technically correct. I don't see any such behavior change in psql, so I agree that this is probably something to ask

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Rihad
On 8/21/23 20:17, Adrian Klaver wrote: On 8/21/23 09:09, Rihad wrote: On 8/21/23 20:00, Adrian Klaver wrote: Thanks for the detailed reply, no tables have custom settings. I need to make it clear once again that all autovac/analyze work as expected when n_live_tup matches reality, i.e. whe

Re: Will PostgreSQL 16 supports native transparent data encryption ?

2023-08-21 Thread Adrian Klaver
On 8/21/23 09:02, Mostafa Fathy wrote: Hi there, It is mentioned here https://www.postgresql.org/about/press/faq/#:~:text=Q%3A%20What%20features%20will%20PostgreSQL%2016%20have%3F  tha

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Adrian Klaver
On 8/21/23 09:09, Rihad wrote: On 8/21/23 20:00, Adrian Klaver wrote: Thanks for the detailed reply, no tables have custom settings. I need to make it clear once again that all autovac/analyze work as expected when n_live_tup matches reality, i.e. when analyze has been run on them since la

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Rihad
On 8/21/23 20:00, Adrian Klaver wrote: On 8/20/23 22:31, Rihad wrote: On 8/21/23 00:15, Adrian Klaver wrote: On 8/20/23 12:10, Rihad wrote: On 8/20/23 20:22, Adrian Klaver wrote: On 8/18/23 22:35, Rihad wrote: On 8/17/23 13:01, rihad wrote: Hard to say without seeing the actual setting

Will PostgreSQL 16 supports native transparent data encryption ?

2023-08-21 Thread Mostafa Fathy
Hi there, It is mentioned here https://www.postgresql.org/about/press/faq/#:~:text=Q%3A%20What%20features%20will%20PostgreSQL%2016%20have%3F that native transparent data encryption is being worked on and it may be delivered with PostgreSQL 16. Is PostgreSQL 16 beta version includes native transpa

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Adrian Klaver
On 8/20/23 22:31, Rihad wrote: On 8/21/23 00:15, Adrian Klaver wrote: On 8/20/23 12:10, Rihad wrote: On 8/20/23 20:22, Adrian Klaver wrote: On 8/18/23 22:35, Rihad wrote: On 8/17/23 13:01, rihad wrote: Hard to say without seeing the actual settings in postgresql.conf that match: http

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread David G. Johnston
On Mon, Aug 21, 2023 at 8:28 AM Edoardo Panfili < edoardo.panf...@iisgubbio.edu.it> wrote: > >dim1 real DEFAULT '-1' NOT NULL > > System.out.print("p: "+rs.getString("dim1")+"\n”); > > Can I do something to avoid this problem? > Use the type appropriate getter, not getString, to retrieve

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Adrian Klaver
On 8/21/23 08:27, Edoardo Panfili wrote: Hello, I am using postgresql version: 15.3 (Debian 15.3-0+deb12u1) org.postgresql.postgresql JDBC driver version: 42.6.0 via Java 17.0.7 I discovered an unattended (for me) situation: when I execute 10 times the same prepared query the result is not alway

The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Edoardo Panfili
Hello, I am using postgresql version: 15.3 (Debian 15.3-0+deb12u1) org.postgresql.postgresql JDBC driver version: 42.6.0 via Java 17.0.7 I discovered an unattended (for me) situation: when I execute 10 times the same prepared query the result is not always the same. I wrote a little test case to

Re: A Good Beginner's Book

2023-08-21 Thread Wen Yi
I think the postgresql's document is the best place to learn. Yours, Wen Yi ---Original--- From: "Amn Ojee Uw"

Re: Loops and Case Statements Involving Dates

2023-08-21 Thread Ron
Since this code is in a loop, consider using clock_timestamp() instead of now(). It might not matter in this situation, though. On 8/21/23 02:07, Anthony Apollis wrote: *Please review my code and make recommendations where needed. I have this code: *``` NUMBER OF LOOPS FOR POSTGRESQL ETL: SELE

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Ron
On 8/20/23 14:10, Rihad wrote: On 8/20/23 20:22, Adrian Klaver wrote: On 8/18/23 22:35, Rihad wrote: On 8/17/23 13:01, rihad wrote: Hi, all. After calling pg_stat_reset all statistics used by autovacuum got zeroed, and started accumulating from scratch. Some tables get acted upon properly,

Re: Loops and Case Statements Involving Dates

2023-08-21 Thread Peter J. Holzer
On 2023-08-21 09:07:00 +0200, Anthony Apollis wrote: > Please review my code and make recommendations where needed. I have this code: > ``` [complicated code snipped] > > > I have re-written this code to make it less complex, still doing what > it is supposed to do. I want you to review my re-wri

Re: LDAP Authentication

2023-08-21 Thread Emile Amewoto
Hi Roger, Here is the high level process: 1- Create the user x without password in Postgres. 2- Assign role or roles to the user x 3- Update pg_hba.conf with the ldap connection link. You might need cert for the ldap to connect to AD, assuming you are using AD. Regards, Emile > On 21 Aug 2023,

LDAP Authentication

2023-08-21 Thread Roger Tannous
Hello, In section 21.10 LDAP Authentication of the documentation, it says that the DB *user must already exist in the database before LDAP can be used for authentication*. I'm checking the possibility to use LDAP Authentication with Postgre

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Rihad
On 8/21/23 00:15, Adrian Klaver wrote: On 8/20/23 12:10, Rihad wrote: On 8/20/23 20:22, Adrian Klaver wrote: On 8/18/23 22:35, Rihad wrote: On 8/17/23 13:01, rihad wrote: Hi, all. After calling pg_stat_reset all statistics used by autovacuum got zeroed, and started accumulating from scratch

Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

2023-08-21 Thread Rihad
On 8/20/23 20:22, Adrian Klaver wrote: On 8/18/23 22:35, Rihad wrote: On 8/17/23 13:01, rihad wrote: Hi, all. After calling pg_stat_reset all statistics used by autovacuum got zeroed, and started accumulating from scratch. Some tables get acted upon properly, some don't. Self-replying: yu

Re: Loops and Case Statements Involving Dates

2023-08-21 Thread jian he
On Mon, Aug 21, 2023 at 3:07 PM Anthony Apollis wrote: > > Please review my code and make recommendations where needed. I have this code: > ``` > NUMBER OF LOOPS FOR POSTGRESQL ETL: > SELECT > CASE > WHEN (((EXTRACT(DAY FROM > ((CASE > WHEN > (SELECT DISTINCT "CALDAY" FROM “system”.”IMETA_ZACTPRIC

Loops and Case Statements Involving Dates

2023-08-21 Thread Anthony Apollis
*Please review my code and make recommendations where needed. I have this code: *``` NUMBER OF LOOPS FOR POSTGRESQL ETL: SELECT CASE WHEN (((EXTRACT(DAY FROM ((CASE WHEN (SELECT D