Re: Need to check each element of an array satisfies a foreign key constraint

2021-07-13 Thread David Gauthier
.@gmail.com> wrote: > On Tuesday, July 13, 2021, David Gauthier > wrote: >> >> >> I suppose I could write a stored procedure to do this and call it in a >> check constraint. But I was wondering if there is something more elegant. >> >> > You cannot use a

Getting "ERROR: upper bound of FOR loop cannot be null" when trying to use a stored proc in a check constraint def.

2021-07-16 Thread David Gauthier
This stored procedure ... create or replace function validate_proj_csv (proj_csv varchar) returns int language plpgsql as $$ -- This function used in a check constraint in the public.projects table to ensure that -- all projects in column sibling_project_csv are valid projects. DECLARE proj_ar

what is pg_stat_activity.query for idle connections ?

2021-09-13 Thread David Gauthier
11.3 on linux I have a DB with a worrisome number of connections with pg_stat_activity.query = '/* DBD::Pg ping test v3.5.3 */', all of them with state='idle'. I have code that uses perl's ping method to ping the DB and I suspect this is the source. Is '/* DBD::Pg ping test v3.5.3 */' the last t

How is JSON stored in PG ?

2021-11-16 Thread David Gauthier
Hi: psql (11.5, server 11.3) on linux I'm considering using JSON as a datatype for something I'm working on. The reasons are... 1) the 'metadata' (if you want to call it that) in JSON is very flexible. Doesn't require an alter table or anything like that to change. 2) The customers for this dat

Wildcarding json keys in json query

2021-11-30 Thread David Gauthier
PG 11.5 on linux Let's say I store a jsonb in a column called test_results that looks like this... { ports : { port_abc:{min: 5, max: 7, mean: 6}, port_def:{min: 5, max: 9, mean: 7}, port_ghi:{min: 6, max: 10, mean: 8} } } And I want to to get all the port names where the mean is

Insert binary file into bytea where PG server does not have access to the file ?

2021-12-03 Thread David Gauthier
11.5 on linux Big corp with an IT dept providing us with PG DBs running in instances on their servers. (We/I amd not DBA).We on the client side, the "users" of these DBs, want to load binary files into bytea type columns. But the files we want to load are on disks that the server does not hav

performance expectations for table(s) with 2B recs

2021-12-08 Thread David Gauthier
11.5 on linux server = VM provided by our IT dept (IOW, can be grown if needed) DB itself is on NFS So far, the tables I have in my DB have relatively low numbers of records (most are < 10K, all are < 10M). Things have been running great in terms of performance. But a project is being brainstorm

storing zipped SQLite inside PG ?

2021-12-21 Thread David Gauthier
Hi: I need a sanity check (brainstorming) before I jump into coding something that might have a better solution known to a community like this one. Here's the situation... To begin with... PG 11.5 on linux. Some code (nature unimportant to this discussion) generates a lot (a lot) of data and stu

Re: storing zipped SQLite inside PG ?

2021-12-21 Thread David Gauthier
. Maybe I can get them to upgrade the DB itself. Thank You too David ! On Tue, Dec 21, 2021 at 10:14 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tuesday, December 21, 2021, David Gauthier > wrote: > >> >> OK, you get the picture. I'm a

"could not receive data from client" && "incomplete startup packet"

2018-02-07 Thread David Gauthier
Hi: I'm experiencing what appears to be an intermittent db connection problem of some sort (although I may be wrong about that). I have a v9.3.0 PG DB on a linux box as the DB server. The client is a virtual machine (also linux) running the same version... *server side:* sqf=# select version();

Re: "could not receive data from client" && "incomplete startup packet"

2018-02-07 Thread David Gauthier
this, I'll be happy with that, else I'll point to the more recent perl versions. Thanks Again On Wed, Feb 7, 2018 at 9:47 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Feb 7, 2018 at 7:34 AM, David Gauthier > wrote: > >> I have a v9.

Re: "could not receive data from client" && "incomplete startup packet"

2018-02-07 Thread David Gauthier
rest of the perl script. On Wed, Feb 7, 2018 at 11:59 AM, David Gauthier wrote: > Hi David, thanks for the response. > > I upgraded to 9.3.2 and recreated the DB there. So far, so good. But > nights are usually the worse time, so we'll see later. > There is a more current vers

Re: "could not receive data from client" && "incomplete startup packet"

2018-02-07 Thread David Gauthier
ndora pandora 4096 Oct 19 2016 /tool/pandora64/.package/postgresql-9.6.0 What about 9.6.0 ? On Wed, Feb 7, 2018 at 4:47 PM, David Gauthier wrote: > I think I found out what's going on. > In the perl script, I'm "forking" a parallel process. The DB connection > gets me

Re: "could not receive data from client" && "incomplete startup packet"

2018-02-08 Thread David Gauthier
Hi Alvaro: It's a corporate "public" posting, so I can't simply install stuff there. However, I can request that new version(s) be put there. What version would you recommend ? -dave On Wed, Feb 7, 2018 at 6:24 PM, Alvaro Herrera wrote: > David Gauthier wrote:

<    1   2