Right version of jdbc

2023-09-25 Thread Raivo Rebane
Hi,
I use :
  PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo


Re: Right version of jdbc

2023-09-25 Thread Thomas Kellerer
Raivo Rebane schrieb am 25.09.2023 um 10:36:
> I use :
>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
> and
> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>
> What versions of jdbc driver I have to use for proper work ?

Use the latest, i.e. 42.6.0






Re: debugger from superuser only.... why?

2023-09-25 Thread Alexander Petrossian
22 сент. 2023 г., в 14:20, Luca Ferrari  написал(а):
>> Checked few sources, can not seem to find reasoning behind this limit:
>> You must have superuser privileges to use the debugger.
>> What is the reason?
> I suspect the debugger will need to open a connection back to pgadmin,
> and that probably is the need for privileges.


Not sure.

I’ve collected log for supseruser debug session under IntelliJ plugin.

Playing this under non-privileged user... some commands pass (below for 
history) and this one does not:

> SELECT * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL);
> ERROR: must be a superuser to create a breakpoint

I am wondering why is this, why not allow debugging for non-privileged users?

PAF

P.S. those that pass are

> SELECT setting
> FROM pg_settings
> WHERE name = 'shared_preload_libraries';
> 
> SELECT * FROM (SELECT
>t_namespace.nspname,
>t_extension.extname,
>t_extension.extversion
>FROM pg_extension t_extension
> JOIN pg_namespace t_namespace ON 
> t_extension.extnamespace = t_namespace.oid)q;
> 
> SELECT * FROM (SELECT pid,
>   application_name,
>   usename,
>   client_addr
>FROM pg_stat_activity
>WHERE application_name = 'idea_debugger'
>  AND pid <> pg_backend_pid())q;
> SELECT * FROM pldbg_create_listener();


Re: debugger from superuser only.... why?

2023-09-25 Thread Alexander Petrossian (PAF)
>
>
> > SELECT * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL);
> > ERROR: must be a superuser to create a breakpoint
> > I am wondering why is this, why not allow debugging for non-privileged
> users?
>
> Again, I'm suspecting that this debugger works by performing a
> sandboxing and attaching your session back. In order to communicate
> back and forth, you probably need such privileges.
> You should ask the developers why they need such privileges, or dig
> the code by yourself.
>

Some mail list you would suggest, Luka?


> > SELECT * FROM pldbg_create_listener();
> uh oh, it mentions a listener...then there must be some "sender"
> somehwere, that probably needs privileges.
>

Surprisingly this passes OK under non-privileged user.

PAF


Re: Accessing system information functions

2023-09-25 Thread Erik Wienhold
On 2023-09-22 17:37 +, Johnson, Bruce E - (bjohnson) wrote:
> postgres=# pg_database_size(avi);
> ERROR:  syntax error at or near "pg_database_size"
> LINE 1: pg_database_size(avi);

Call functions with SELECT, e.g.:

SELECT pg_database_size('avi');

Also, the database name must be a string.

> Do I have to add anything to the search_path?

Not for objects in schema pg_catalog which is always searched whether
it's listed in the search path or not.

-- 
Erik




Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Hello

We are using postgres 11.5 on Ubuntu we have enabled logging and set
log_statements to all but when I checked the statements in the logs I can
see only first few lines of the query and also when I check in pgadmin for
current queries I could see only few lines. Some one please help me to get
full queries in the logs and in pgadmin4.


Re: Right version of jdbc

2023-09-25 Thread Dave Cramer
Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks


On Mon, 25 Sept 2023 at 07:03, Raivo Rebane  wrote:

> Hi,
> I use :
>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
> and
> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>
> What versions of jdbc driver I have to use for proper work ?
>
> Regards,
> Raivo
>
>
>
>


Re: Right version of jdbc

2023-09-25 Thread Dave Cramer
Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks


On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
wrote:

> Hi,
>
> The latest version of the driver is usually the right answer. So 42.5.4
> Dave Cramer
> www.postgres.rocks
>
>
> On Mon, 25 Sept 2023 at 07:03, Raivo Rebane  wrote:
>
>> Hi,
>> I use :
>>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>> and
>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>>
>> What versions of jdbc driver I have to use for proper work ?
>>
>> Regards,
>> Raivo
>>
>>
>>
>>


Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Laurenz Albe
On Mon, 2023-09-25 at 16:54 +0530, shashidhar Reddy wrote:
> We are using postgres 11.5 on Ubuntu we have enabled logging and set
> log_statements to all but when I checked the statements in the logs I
> can see only first few lines of the query

I don't know about pgAdmin, but the log will certainly have the complete
statement.

Yours,
Laurenz Albe




Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Hi Laurenz,

Iog is also showing few lines that is incomplete statement.

On Mon, 25 Sept, 2023, 5:05 pm Laurenz Albe, 
wrote:

> On Mon, 2023-09-25 at 16:54 +0530, shashidhar Reddy wrote:
> > We are using postgres 11.5 on Ubuntu we have enabled logging and set
> > log_statements to all but when I checked the statements in the logs I
> > can see only first few lines of the query
>
> I don't know about pgAdmin, but the log will certainly have the complete
> statement.
>
> Yours,
> Laurenz Albe
>


Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Erik Wienhold
On 2023-09-25 16:54 +0530, shashidhar Reddy wrote:
> We are using postgres 11.5 on Ubuntu we have enabled logging and set
> log_statements to all but when I checked the statements in the logs I can
> see only first few lines of the query and also when I check in pgadmin for
> current queries I could see only few lines. Some one please help me to get
> full queries in the logs and in pgadmin4.

* Could be that the logging collector truncates messages.  Are all
  messages truncated to the same length?

* pgAdmin reads pg_stat_activity.query which is subject to config
  track_activity_query_size[1].  That should, however, not affect
  logging.

* Maybe a bug 11.5 which is already 4 years old.

[1] 
https://www.postgresql.org/docs/11/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE

-- 
Erik




Re: Right version of jdbc

2023-09-25 Thread Raivo Rebane
Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer 
wrote:

> Sorry 42.6.0
>
> Interesting that github still has 42.5.4 as the release
>
> Dave Cramer
> www.postgres.rocks
>
>
> On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
> wrote:
>
>> Hi,
>>
>> The latest version of the driver is usually the right answer. So 42.5.4
>> Dave Cramer
>> www.postgres.rocks
>>
>>
>> On Mon, 25 Sept 2023 at 07:03, Raivo Rebane  wrote:
>>
>>> Hi,
>>> I use :
>>>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>>> and
>>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>>>
>>> What versions of jdbc driver I have to use for proper work ?
>>>
>>> Regards,
>>> Raivo
>>>
>>>
>>>
>>>


Re: Right version of jdbc

2023-09-25 Thread Dave Cramer
The missing class is from the postgis jar. Are you sure it is on your
classpath ?

Dave Cramer
www.postgres.rocks


On Mon, 25 Sept 2023 at 08:26, Raivo Rebane  wrote:

> Hi,
> now I using following -
> [INFO] Copying postgis-jdbc-2.1.7.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
> [INFO] Copying postgresql-42.6.0.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
> [INFO] Copying checker-qual-3.31.0.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
> but on executions I got -
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/postgis/PGgeometry
> at
> backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
> at backendproject.BackendMain.main(BackendMain.java:81)
> Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
> at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
> at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
>
> What I have to do ?
>
> I use following -
> PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
> Regards
> Raivo
>
> On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer 
> wrote:
>
>> Sorry 42.6.0
>>
>> Interesting that github still has 42.5.4 as the release
>>
>> Dave Cramer
>> www.postgres.rocks
>>
>>
>> On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
>> wrote:
>>
>>> Hi,
>>>
>>> The latest version of the driver is usually the right answer. So 42.5.4
>>> Dave Cramer
>>> www.postgres.rocks
>>>
>>>
>>> On Mon, 25 Sept 2023 at 07:03, Raivo Rebane  wrote:
>>>
 Hi,
 I use :
   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
 and
 PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

 What versions of jdbc driver I have to use for proper work ?

 Regards,
 Raivo






Re: Accessing system information functions

2023-09-25 Thread Rob Sargent
On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson)  wrote:




Environment: Ubuntu 22.04 lts, postgres 15 installed via 
postgres.org repository


I am attempting to use the system information functions here: https://www.postgresql.org/docs/15/functions-info.html


I’m logged on as the postgres superuser on the host


Trying any of the functions gives me a syntax error




postgres=# pg_database_size(avi);

ERROR:  syntax error at or near "pg_database_size"

LINE 1: pg_database_size(avi);

 
Do I have to add anything to the search_path?




postgres=# show search_path;

   search_path   

-

 "$user", public

(1 row)





Select pg_database_size(avi);






Re: Accessing system information functions

2023-09-25 Thread Rob Sargent
On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson)  wrote:




Environment: Ubuntu 22.04 lts, postgres 15 installed via 
postgres.org repository


I am attempting to use the system information functions here: https://www.postgresql.org/docs/15/functions-info.html


I’m logged on as the postgres superuser on the host


Trying any of the functions gives me a syntax error




postgres=# pg_database_size(avi);

ERROR:  syntax error at or near "pg_database_size"

LINE 1: pg_database_size(avi);

 
Do I have to add anything to the search_path?




postgres=# show search_path;

   search_path   

-

 "$user", public

(1 row)





And single quote name. 'avi'
-- 
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs








Re: Right version of jdbc

2023-09-25 Thread Raivo Rebane
Hi, now I use -
  

org.postgis
postgis-jdbc
1.3.3


org.postgresql
postgresql
42.5.4 

  
But I got error -
Exception in thread "main" java.lang.NoSuchMethodError:
'org.postgresql.core.Encoding
org.postgresql.core.BaseConnection.getEncoding()'
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
at backendproject.BackendMain.main(BackendMain.java:64)

Whats wrong ?

Raivo

On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane  wrote:

> Hi,
> now I using following -
> [INFO] Copying postgis-jdbc-2.1.7.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
> [INFO] Copying postgresql-42.6.0.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
> [INFO] Copying checker-qual-3.31.0.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
> but on executions I got -
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/postgis/PGgeometry
> at
> backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
> at backendproject.BackendMain.main(BackendMain.java:81)
> Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
> at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
> at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
>
> What I have to do ?
>
> I use following -
> PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
> Regards
> Raivo
>
> On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer 
> wrote:
>
>> Sorry 42.6.0
>>
>> Interesting that github still has 42.5.4 as the release
>>
>> Dave Cramer
>> www.postgres.rocks
>>
>>
>> On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
>> wrote:
>>
>>> Hi,
>>>
>>> The latest version of the driver is usually the right answer. So 42.5.4
>>> Dave Cramer
>>> www.postgres.rocks
>>>
>>>
>>> On Mon, 25 Sept 2023 at 07:03, Raivo Rebane  wrote:
>>>
 Hi,
 I use :
   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
 and
 PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

 What versions of jdbc driver I have to use for proper work ?

 Regards,
 Raivo






Re: Right version of jdbc

2023-09-25 Thread Raivo Rebane
And target/lib is s following :
Directory of C:\Users\Raivo\eclipse-workspace\backendproject\target\lib

25.09.2023  15:35  .
25.09.2023  15:33  ..
25.09.2023  15:33   214 381 checker-qual-3.5.0.jar
25.09.2023  13:1475 847 postgis-jdbc-1.3.3.jar
25.09.2023  13:14 2 833 postgis-stubs-1.3.3.jar
25.09.2023  15:33 1 049 651 postgresql-42.5.4.jar
25.09.2023  13:14   474 746 postgresql-8.3-603.jdbc4.jar

Raivo


On Mon, Sep 25, 2023 at 3:38 PM Raivo Rebane  wrote:

> Hi, now I use -
>   
> 
> org.postgis
> postgis-jdbc
> 1.3.3
> 
> 
> org.postgresql
> postgresql
> 42.5.4 
> 
>   
> But I got error -
> Exception in thread "main" java.lang.NoSuchMethodError:
> 'org.postgresql.core.Encoding
> org.postgresql.core.BaseConnection.getEncoding()'
> at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
> at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
> at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
> at backendproject.BackendMain.main(BackendMain.java:64)
>
> Whats wrong ?
>
> Raivo
>
> On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane  wrote:
>
>> Hi,
>> now I using following -
>> [INFO] Copying postgis-jdbc-2.1.7.jar to
>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
>> [INFO] Copying postgresql-42.6.0.jar to
>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
>> [INFO] Copying checker-qual-3.31.0.jar to
>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
>> but on executions I got -
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/postgis/PGgeometry
>> at
>> backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
>> at backendproject.BackendMain.main(BackendMain.java:81)
>> Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
>> at
>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
>> at
>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
>>
>> What I have to do ?
>>
>> I use following -
>> PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>> Regards
>> Raivo
>>
>> On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer 
>> wrote:
>>
>>> Sorry 42.6.0
>>>
>>> Interesting that github still has 42.5.4 as the release
>>>
>>> Dave Cramer
>>> www.postgres.rocks
>>>
>>>
>>> On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
>>> wrote:
>>>
 Hi,

 The latest version of the driver is usually the right answer. So 42.5.4
 Dave Cramer
 www.postgres.rocks


 On Mon, 25 Sept 2023 at 07:03, Raivo Rebane 
 wrote:

> Hi,
> I use :
>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
> and
> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>
> What versions of jdbc driver I have to use for proper work ?
>
> Regards,
> Raivo
>
>
>
>


Re: Right version of jdbc

2023-09-25 Thread Dave Cramer
remove the postgresql-8.3-603.jdbc4.jar
Dave Cramer
www.postgres.rocks


On Mon, 25 Sept 2023 at 08:43, Raivo Rebane  wrote:

> And target/lib is s following :
> Directory of C:\Users\Raivo\eclipse-workspace\backendproject\target\lib
>
> 25.09.2023  15:35  .
> 25.09.2023  15:33  ..
> 25.09.2023  15:33   214 381 checker-qual-3.5.0.jar
> 25.09.2023  13:1475 847 postgis-jdbc-1.3.3.jar
> 25.09.2023  13:14 2 833 postgis-stubs-1.3.3.jar
> 25.09.2023  15:33 1 049 651 postgresql-42.5.4.jar
> 25.09.2023  13:14   474 746 postgresql-8.3-603.jdbc4.jar
>
> Raivo
>
>
> On Mon, Sep 25, 2023 at 3:38 PM Raivo Rebane  wrote:
>
>> Hi, now I use -
>>   
>> 
>> org.postgis
>> postgis-jdbc
>> 1.3.3
>> 
>> 
>> org.postgresql
>> postgresql
>> 42.5.4 
>> 
>>   
>> But I got error -
>> Exception in thread "main" java.lang.NoSuchMethodError:
>> 'org.postgresql.core.Encoding
>> org.postgresql.core.BaseConnection.getEncoding()'
>> at
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
>> at backendproject.BackendMain.main(BackendMain.java:64)
>>
>> Whats wrong ?
>>
>> Raivo
>>
>> On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane  wrote:
>>
>>> Hi,
>>> now I using following -
>>> [INFO] Copying postgis-jdbc-2.1.7.jar to
>>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
>>> [INFO] Copying postgresql-42.6.0.jar to
>>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
>>> [INFO] Copying checker-qual-3.31.0.jar to
>>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
>>> but on executions I got -
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> org/postgis/PGgeometry
>>> at
>>> backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
>>> at backendproject.BackendMain.main(BackendMain.java:81)
>>> Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
>>> at
>>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
>>> at
>>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
>>> at
>>> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
>>>
>>> What I have to do ?
>>>
>>> I use following -
>>> PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>>> Regards
>>> Raivo
>>>
>>> On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer 
>>> wrote:
>>>
 Sorry 42.6.0

 Interesting that github still has 42.5.4 as the release

 Dave Cramer
 www.postgres.rocks


 On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
 wrote:

> Hi,
>
> The latest version of the driver is usually the right answer. So 42.5.4
> Dave Cramer
> www.postgres.rocks
>
>
> On Mon, 25 Sept 2023 at 07:03, Raivo Rebane 
> wrote:
>
>> Hi,
>> I use :
>>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>> and
>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>>
>> What versions of jdbc driver I have to use for proper work ?
>>
>> Regards,
>> Raivo
>>
>>
>>
>>


Re: Right version of jdbc

2023-09-25 Thread Dave Cramer
It must be a dependency to something. postgis ?


Dave Cramer
www.postgres.rocks


On Mon, 25 Sept 2023 at 09:25, Raivo Rebane  wrote:

> Hi,
> postgresql-8.3-603.jdbc4.jar is added by maven maven install. How to
> avoid it ?
>


Re: debugger from superuser only.... why?

2023-09-25 Thread Luca Ferrari
On Fri, Sep 22, 2023 at 9:05 PM  wrote:
>
> hi,
> the first steps to use debugger:
> 1. modify config file
> 2. restart server
> ...
> i would say, enough reasons to be superuser or not?

Well, the above are not privileges "to use" the debugger, rather "to
configure" the debugger.

Luca

>
>




Re: debugger from superuser only.... why?

2023-09-25 Thread Tom Lane
Alexander Petrossian  writes:
>>> I am wondering why is this, why not allow debugging for non-privileged 
>>> users?

Seems obvious to me that it'd be a nasty security hole, ie you could
take control of somebody else's session and make it do things you
don't have permissions for.  Even if there's a way to restrict
debugging connections to sessions owned by the same user, you'd
have a big problem with being able to change the behavior of
security-definer functions.  Clearly, the authors of pldebugger
decided that was a can of worms they didn't care to open.

regards, tom lane




Move from v9.4 to v15

2023-09-25 Thread Brad White
I wanted to thank everyone who helped out in our transition to the new
version.
Thanks especially to Tom, Laurenz, and Adrian.

It has taken over a year, since this upgrade project kept getting
superseded by more important projects, and because I only work with this
client one day a week, but as of this morning, we are finally operating on
v15.

The big issue we ran into, and solved months ago, was the change in default
date time precision.

Besides being on a current version, the two big benefits we are looking
forward to are
   1. support for tracking long running queries.
   2. improved support for replication enabling us to set up a hot backup.

On the flip side, expect more questions as we attempt to get replication
set up.  8: -)

Thanks,
Brad.


Re: Right version of jdbc

2023-09-25 Thread Rob Sargent

On 9/25/23 06:38, Raivo Rebane wrote:

Hi, now I use -
  
    
        org.postgis
        postgis-jdbc
        1.3.3
    
    
        org.postgresql
        postgresql
        42.5.4 
    
  
But I got error -
Exception in thread "main" java.lang.NoSuchMethodError: 
'org.postgresql.core.Encoding 
org.postgresql.core.BaseConnection.getEncoding()'
        at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
        at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
        at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)

        at backendproject.BackendMain.main(BackendMain.java:64)

Whats wrong ?


Show your application CLASSPATH.





Re: Right version of jdbc

2023-09-25 Thread Dave Cramer
You should probably be using the latest version of postgis-jdbc

Maven Repository: net.postgis » postgis-jdbc » 2021.1.0 (mvnrepository.com)


Dave Cramer
www.postgres.rocks


On Mon, 25 Sept 2023 at 08:43, Raivo Rebane  wrote:

> And target/lib is s following :
> Directory of C:\Users\Raivo\eclipse-workspace\backendproject\target\lib
>
> 25.09.2023  15:35  .
> 25.09.2023  15:33  ..
> 25.09.2023  15:33   214 381 checker-qual-3.5.0.jar
> 25.09.2023  13:1475 847 postgis-jdbc-1.3.3.jar
> 25.09.2023  13:14 2 833 postgis-stubs-1.3.3.jar
> 25.09.2023  15:33 1 049 651 postgresql-42.5.4.jar
> 25.09.2023  13:14   474 746 postgresql-8.3-603.jdbc4.jar
>
> Raivo
>
>
> On Mon, Sep 25, 2023 at 3:38 PM Raivo Rebane  wrote:
>
>> Hi, now I use -
>>   
>> 
>> org.postgis
>> postgis-jdbc
>> 1.3.3
>> 
>> 
>> org.postgresql
>> postgresql
>> 42.5.4 
>> 
>>   
>> But I got error -
>> Exception in thread "main" java.lang.NoSuchMethodError:
>> 'org.postgresql.core.Encoding
>> org.postgresql.core.BaseConnection.getEncoding()'
>> at
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
>> at backendproject.BackendMain.main(BackendMain.java:64)
>>
>> Whats wrong ?
>>
>> Raivo
>>
>> On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane  wrote:
>>
>>> Hi,
>>> now I using following -
>>> [INFO] Copying postgis-jdbc-2.1.7.jar to
>>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
>>> [INFO] Copying postgresql-42.6.0.jar to
>>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
>>> [INFO] Copying checker-qual-3.31.0.jar to
>>> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
>>> but on executions I got -
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> org/postgis/PGgeometry
>>> at
>>> backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
>>> at backendproject.BackendMain.main(BackendMain.java:81)
>>> Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
>>> at
>>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
>>> at
>>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
>>> at
>>> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
>>>
>>> What I have to do ?
>>>
>>> I use following -
>>> PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>>> Regards
>>> Raivo
>>>
>>> On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer 
>>> wrote:
>>>
 Sorry 42.6.0

 Interesting that github still has 42.5.4 as the release

 Dave Cramer
 www.postgres.rocks


 On Mon, 25 Sept 2023 at 07:27, Dave Cramer 
 wrote:

> Hi,
>
> The latest version of the driver is usually the right answer. So 42.5.4
> Dave Cramer
> www.postgres.rocks
>
>
> On Mon, 25 Sept 2023 at 07:03, Raivo Rebane 
> wrote:
>
>> Hi,
>> I use :
>>   PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
>> and
>> PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>>
>> What versions of jdbc driver I have to use for proper work ?
>>
>> Regards,
>> Raivo
>>
>>
>>
>>


Accessing system information functions

2023-09-25 Thread Johnson, Bruce E - (bjohnson)
Environment: Ubuntu 22.04 lts, postgres 15 installed via 
postgres.org repository

I am attempting to use the system information functions here: 
https://www.postgresql.org/docs/15/functions-info.html

I’m logged on as the postgres superuser on the host

Trying any of the functions gives me a syntax error


postgres=# pg_database_size(avi);

ERROR:  syntax error at or near "pg_database_size"

LINE 1: pg_database_size(avi);


Do I have to add anything to the search_path?


postgres=# show search_path;

   search_path

-

 "$user", public

(1 row)



--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs




Re: Accessing system information functions

2023-09-25 Thread Pavel Stehule
Hi

po 25. 9. 2023 v 19:51 odesílatel Rob Sargent 
napsal:

>
>
> On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson) <
> john...@pharmacy.arizona.edu> wrote:
>
>  Environment: Ubuntu 22.04 lts, postgres 15 installed via postgres.org 
> repository
>
>
> I am attempting to use the system information functions here:
> https://www.postgresql.org/docs/15/functions-info.html
>
> I’m logged on as the postgres superuser on the host
>
> Trying any of the functions gives me a syntax error
>
> postgres=# pg_database_size(avi);
>
> ERROR:  syntax error at or near "pg_database_size"
>
> LINE 1: pg_database_size(avi);
>
> Do I have to add anything to the search_path?
>
> postgres=# show search_path;
>
>search_path
>
> -
>
>  "$user", public
>
> (1 row)
>
>
>
you are missing SELECT keyword

 (2023-09-25 20:05:08) postgres=# select pg_database_size('postgres');
┌──┐
│ pg_database_size │
╞══╡
│  7901667 │
└──┘
(1 row)


Regards

Pavel


>
> And single quote name. 'avi'
>
> --
> Bruce Johnson
> University of Arizona
> College of Pharmacy
> Information Technology Group
>
> Institutions do not have opinions, merely customs
>
>
>


Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Adrian Klaver

On 9/25/23 11:55, shashidhar Reddy wrote:

Thank you Erik,

Not all queries are truncated at same size,different queries different 
sizes but all 11.5 servers are behaving in same manner.


FYI, the last minor release for version is 11.21. You are missing 16 
bug/security fixes. I would update to 11.21 and then see if the issue 
persists.





On Mon, 25 Sept, 2023, 5:33 pm Erik Wienhold, > wrote:


On 2023-09-25 16:54 +0530, shashidhar Reddy wrote:
 > We are using postgres 11.5 on Ubuntu we have enabled logging and set
 > log_statements to all but when I checked the statements in the
logs I can
 > see only first few lines of the query and also when I check in
pgadmin for
 > current queries I could see only few lines. Some one please help
me to get
 > full queries in the logs and in pgadmin4.

* Could be that the logging collector truncates messages.  Are all
   messages truncated to the same length?

* pgAdmin reads pg_stat_activity.query which is subject to config
   track_activity_query_size[1].  That should, however, not affect
   logging.

* Maybe a bug 11.5 which is already 4 years old.

[1]

https://www.postgresql.org/docs/11/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE
 


-- 
Erik




--
Adrian Klaver
adrian.kla...@aklaver.com





Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Thank you Erik,

Not all queries are truncated at same size,different queries different
sizes but all 11.5 servers are behaving in same manner.


On Mon, 25 Sept, 2023, 5:33 pm Erik Wienhold,  wrote:

> On 2023-09-25 16:54 +0530, shashidhar Reddy wrote:
> > We are using postgres 11.5 on Ubuntu we have enabled logging and set
> > log_statements to all but when I checked the statements in the logs I can
> > see only first few lines of the query and also when I check in pgadmin
> for
> > current queries I could see only few lines. Some one please help me to
> get
> > full queries in the logs and in pgadmin4.
>
> * Could be that the logging collector truncates messages.  Are all
>   messages truncated to the same length?
>
> * pgAdmin reads pg_stat_activity.query which is subject to config
>   track_activity_query_size[1].  That should, however, not affect
>   logging.
>
> * Maybe a bug 11.5 which is already 4 years old.
>
> [1]
> https://www.postgresql.org/docs/11/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE
>
> --
> Erik
>


Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Thank you Adrian! I will apply the patch and see.

On Tue, 26 Sept, 2023, 12:53 am Adrian Klaver, 
wrote:

> On 9/25/23 11:55, shashidhar Reddy wrote:
> > Thank you Erik,
> >
> > Not all queries are truncated at same size,different queries different
> > sizes but all 11.5 servers are behaving in same manner.
>
> FYI, the last minor release for version is 11.21. You are missing 16
> bug/security fixes. I would update to 11.21 and then see if the issue
> persists.
>
> >
> >
> > On Mon, 25 Sept, 2023, 5:33 pm Erik Wienhold,  > > wrote:
> >
> > On 2023-09-25 16:54 +0530, shashidhar Reddy wrote:
> >  > We are using postgres 11.5 on Ubuntu we have enabled logging and
> set
> >  > log_statements to all but when I checked the statements in the
> > logs I can
> >  > see only first few lines of the query and also when I check in
> > pgadmin for
> >  > current queries I could see only few lines. Some one please help
> > me to get
> >  > full queries in the logs and in pgadmin4.
> >
> > * Could be that the logging collector truncates messages.  Are all
> >messages truncated to the same length?
> >
> > * pgAdmin reads pg_stat_activity.query which is subject to config
> >track_activity_query_size[1].  That should, however, not affect
> >logging.
> >
> > * Maybe a bug 11.5 which is already 4 years old.
> >
> > [1]
> >
> https://www.postgresql.org/docs/11/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE
> <
> https://www.postgresql.org/docs/11/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE
> >
> >
> > --
> > Erik
> >
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>
>


Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Adrian Klaver

On 9/25/23 19:30, shashidhar Reddy wrote:

Thank you Adrian! I will apply the patch and see.


Just to be clear 11.21 represents the changes from 16 different minor 
releases.


--
Adrian Klaver
adrian.kla...@aklaver.com