Re: Generic File Access Function to read program output

2024-02-07 Thread Carsten Klein
Am 07.02.2024 um 15:54 schrieb Joe Conway: Maybe write your own in plpython or plperlu? Yeah... why didn't I think of if? PL/Python would be a first class option. Nevertheless, I still believe such a function in PostgreSQL's core would be a good addition. Maybe someone feels like implementi

Generic File Access Function to read program output

2024-02-07 Thread Carsten Klein
Hi there, on PostgreSQL 14, I'm using function pg_read_file to read a JSON file on the server. After that, the JSON file gets casted to jsonb and with function jsonb_array_elements I'm iterating over the "records", which I transform into a PostgreSQL ROWTYPE with jsonb_populate_record... Sin

File-Access functions by default not executable by predefined role "pg_read_server_files"

2023-05-30 Thread Carsten Klein
Hi there, in PG 14, you've removed explicit 'superuser()' checks in file-access functions (like pg_ls_dir, pg_read_file, etc.) and moved to an ACL based approach to restrict access to these functions. In turn, you've also removed EXECUTE permission from role "public", leaving these functions

Re:

2023-02-21 Thread Carsten Klein
Hi Alberto, AFAIK, it's described here: (not using postgresql https://www.pgadmin.org/download/pgadmin-4-apt/ Follow the instructions in the gray box below the package list. Carsten Am 21.02.2023 um 13:44 schrieb Alberto García Fumero: Good morning to all. I'd need some advice. I'm tryin

Re: Connect to specific cluster on command line

2022-05-25 Thread Carsten Klein
On Wed 2022-05-25 at 17:05 David G. Johnston wrote: IIRC they write wrapper scripts they put into the version-agnostic bin directory that deal with the version/cluster-name scheme they’ve setup before calling the core commands located in the version-specific install directory. You are comple

Re: Connect to specific cluster on command line

2022-05-25 Thread Carsten Klein
pg_lsclusters is not part of core Postgres, and neither is this --cluster option you mention. I'm vaguely aware that some packager (Debian I think) has added an overlay of that sort; but you'd need to consult the package-level documentation not the community docs in order to find out more.

Connect to specific cluster on command line

2022-05-25 Thread Carsten Klein
Hi there, how can I connect to a specific cluster on the command line, e. g. with psql, pg_dump or pg_dumpall? pg_lsclusters returns a list of all clusters available: Ver Cluster Port [...] 14 main5432 ... 14 test5433 ... I want to connect to or dump database xyz in the test clust

Re: Strange results when casting string to double

2022-02-20 Thread Carsten Klein
On 19.02.2022 20:34 Tom Lane wrote: Per grep, there is no call of fesetround() in the Postgres source tree. I'm not sure offhand whether libc exposes any other APIs that could change the rounding mode, but I am quite sure that we wouldn't be intentionally changing it anywhere. The OS would

Re: Strange results when casting string to double

2022-02-19 Thread Carsten Klein
On 19.02.2022 15:35, Tomas Pospisek wrote: That would be visible via `lsof`. `libc. The file `...libc...so` that `postgres` is keeping open would have the text `DEL` (as in deleted) in the `FD` column of `lsof`'s output. As opposed to a newly started program which would have `REG` (regula

Re: Strange results when casting string to double

2022-02-18 Thread Carsten Klein
On 18.02.2022 16:32, Tom Lane wrote: Yeah, you said that upthread, which makes the whole thing pretty baffling. One possible explanation is that your small program got linked against a different version of libc than what the Postgres backend is using ("ldd" would help you check that, but giv

Re: Strange results when casting string to double

2022-02-18 Thread Carsten Klein
On 18.02.2022 13:28, Peter Eisentraut wrote: float8in() really just calls the operating system's strtod() function. I would test that one directly with a small C program. It's also possible that different compiler options lead to different optimizations. That's what I did. Here's my sma

Re: Strange results when casting string to double

2022-02-17 Thread Carsten Klein
AOn Thu, Feb 17, 2022 at 10:27 AM Peter J. Holzer wrote I don't think these explain the difference. I'd check whether the postgresql binaries and all the the shared libraries are the same. Or - since this only happens on the test system and not on the production system - I'd just clone the p

Re: Strange results when casting string to double

2022-02-17 Thread Carsten Klein
On Thu, Feb 17, 2022 at 09:41 AM Thomas Kellerer wrote: Carsten Klein schrieb am 16.02.2022 um 14:27: Ah, man versteht sich :) I'm using several (now unsupported) PostgreSQL 9.3.24 servers on different (ancient) Ubuntu 14.04 LTS machines. On only one of those servers, I get strange/

Re: Strange results when casting string to double

2022-02-17 Thread Carsten Klein
On Thu, Feb 17, 2022 at 00:07 Gavan Schneider wrote: Harking back to my long distant formative years I was taught to never ever rely on equality tests when it came to floating point values. Nothing has changed in this regard. If binary exact is part of the requirement then the answer is I

Re: Strange results when casting string to double

2022-02-16 Thread Carsten Klein
On Wed, Feb 16, 2022 at 08:11 PM David G. Johnston wrote: You said they are more or less the same.  Problems like these tend to hide in the "less" portion of the inequality. On of the virtualized servers was created as a clone of the other one (using VMware to clone the VM). So, basically,

Re: Strange results when casting string to double

2022-02-16 Thread Carsten Klein
On Wed, Feb 16, 2022 at 05:46 PM Adrian Klaver wrote On 2/16/22 05:27, Carsten Klein wrote: Hi there, I'm using several (now unsupported) PostgreSQL 9.3.24 servers on different (ancient) Ubuntu 14.04 LTS machines. On only one of those servers, I get strange/wrong results when convert

Strange results when casting string to double

2022-02-16 Thread Carsten Klein
ers are configured quite the same (more or less). All run with the same extensions installed; none is using any preloaded libraries (which may replace C library function strtod?). -- Carsten Klein c(dot)klein(@)datagis(dot)com