Unexpected result count from update statement on partitioned table

2020-12-17 Thread Craig McIlwee
Hello, Our application uses a queue-like table to assign tasks to users and this has worked well for us for a few years. Now we are in the process of adding some restrictions to which tasks a user can work on and that is based on an attribute of each task that does not change for the task's lifes

Re: Raise exception without using plpgsql?

2020-12-17 Thread Pavel Stehule
čt 17. 12. 2020 v 17:45 odesílatel hubert depesz lubaczewski < dep...@depesz.com> napsal: > On Thu, Dec 17, 2020 at 03:32:09PM +0100, Joel Jacobson wrote: > > Hi, > > Is there a way to raise an exception with a message, > > without having to add your own plpgsql helper-function? > > Currently this

Re: Raise exception without using plpgsql?

2020-12-17 Thread hubert depesz lubaczewski
On Thu, Dec 17, 2020 at 03:32:09PM +0100, Joel Jacobson wrote: > Hi, > Is there a way to raise an exception with a message, > without having to add your own plpgsql helper-function? > Currently this is what I have: Well, you can: DO $$ begin raise notice 'zz'; END; $$; It's cheating though, as it

SV: SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Gustavsson Mikael
Here is the result. ldd /usr/pgsql-13/bin/psql linux-vdso.so.1 (0x7ffd714d5000) libpq.so.5 => /usr/pgsql-13/lib/libpq.so.5 (0x7f2d1700a000) libpthread.so.0 => /lib64/libpthread.so.0 (0x7f2d16dea000) libreadline.so.7 => /lib64/libreadline.so.7 (0x7f2d16b9b000) libm.so.6 => /lib64/li

Re: SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Tom Lane
Gustavsson Mikael writes: > $ /usr/pgsql-13/bin/psql "dbname=postgres user=kalle host=server > sslmode=require" > psql: error: FATAL: no pg_hba.conf entry for host "nn.nnn.n.nnn", user > "kalle", database "postgres", SSL off > FATAL: no pg_hba.conf entry for host "nn.nnn.n.nnn", user "kalle",

SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Gustavsson Mikael
Sorry, my bad. But i get the same result. $ /usr/pgsql-13/bin/psql "dbname=postgres user=kalle host=server sslmode=require" psql: error: FATAL: no pg_hba.conf entry for host "nn.nnn.n.nnn", user "kalle", database "postgres", SSL off FATAL: no pg_hba.conf entry for host "nn.nnn.n.nnn", user "

Re: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Magnus Hagander
That's setting a variable, not a parameter. You need something like psql "dbname=postgres user=kalle host=server sslmode=require" Or PGSSLMODE=require /usr/bin/pgsql-same-as-you-had-before //Magnus On Thu, Dec 17, 2020 at 5:00 PM Gustavsson Mikael wrote: > > Hi Magnus, > > > The clients 11 an

SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Gustavsson Mikael
Hi Magnus, The clients 11 and 13 is on the same host. Hmm, I get the same error if I set sslmode=require. $ /usr/pgsql-13/bin/psql -d postgres --set=sslmode=require -Ukalle -hserver -W Password: psql: error: FATAL: no pg_hba.conf entry for host "nn.nnn.n.nnn", user "kalle", database "postgr

Re: Raise exception without using plpgsql?

2020-12-17 Thread David G. Johnston
On Thursday, December 17, 2020, Joel Jacobson wrote: > Hi, > > Is there a way to raise an exception with a message, > without having to add your own plpgsql helper-function? > Not that i’ve seen. There is no SQL way to do so, and I’ve not seen a core c-language function that provides that featu

Re: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Magnus Hagander
On Thu, Dec 17, 2020 at 3:36 PM Gustavsson Mikael wrote: > > > Hi, > > log_connections is on. The ERR message is correct, we do not have an entry > for SSL off. > The question is why psql(13) is trying to connect without ssl? > > 2020-12-17T14:25:09.565566+00:00 server INFO [30-1] pgpid=2422778

SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Gustavsson Mikael
Hi, log_connections is on. The ERR message is correct, we do not have an entry for SSL off. The question is why psql(13) is trying to connect without ssl? 2020-12-17T14:25:09.565566+00:00 server INFO [30-1] pgpid=2422778 pguser=[unknown] pghost=nnn.nn.n.nnn pgdb=[unknown] pgapp=[unknown] LOG:

Raise exception without using plpgsql?

2020-12-17 Thread Joel Jacobson
Hi, Is there a way to raise an exception with a message, without having to add your own plpgsql helper-function? Currently this is what I have: CREATE OR REPLACE FUNCTION raise(message text, debug json, dummy_return_value anyelement) RETURNS anyelement LANGUAGE plpgsql AS $$ BEGIN RAISE '% %',

Re: SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Tom Lane
Gustavsson Mikael writes: > Clarification, its the same postgresql13 server. I just connect with > different psql-clients. Perhaps turning on log_connections on the server would offer some insight. It sort of looks like the v13 client is trying to connect with SSL, failing for some unknown reas

SV: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Gustavsson Mikael
Hi, SSL is on. grep ssl /etc/postgresql/13/postgresql.conf ssl = 'on' ssl_cert_file = '/etc/pki/private/xxx_incl_key.pem' ssl_key_file = '/etc/pki/private/xxx.key' Clarification, its the same postgresql13 server. I just connect with different psql-clients. KR ___

Re: Problem with ssl and psql in Postgresql 13

2020-12-17 Thread Kyotaro Horiguchi
Hi. At Thu, 17 Dec 2020 07:21:08 +, Gustavsson Mikael wrote in > But not from psql 13: > $ /usr/pgsql-13/bin/psql -d postgres -Ukalle -hserver -W > Password: > psql: error: FATAL: no pg_hba.conf entry for host "nnn.nn.n.nnn", user > "kalle", database "postgres", SSL off > FATAL: no pg_hb