Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Pavel Stehule
pá 29. 7. 2022 v 4:57 odesílatel Bryn Llewellyn napsal: > > *t...@sss.pgh.pa.us wrote:* > > x...@thebuild.com wrote: > > This isn't a bug. > > > It's actually a feature… > > Having said that, there are certainly aspects of what happens when in > plpgsql that don't have a lot of justification oth

Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> x...@thebuild.com wrote: >> >> This isn't a bug. > > It's actually a feature… > > Having said that, there are certainly aspects of what happens when in plpgsql > that don't have a lot of justification other than being implementation > artifacts… Thanks, Tom.

Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Christophe Pettus
> On Jul 28, 2022, at 18:49, Bryn Llewellyn wrote: > It's this that surprises me. And it's this, and only this, that I'm asking > about: might _just_ this be a fixable bug? It might be surprising, but it's not a bug. You can demonstrate it with a very small test case: CREATE FUNCTION f() R

Re: Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Tom Lane
Christophe Pettus writes: >> On Jul 28, 2022, at 18:04, Bryn Llewellyn wrote: >> Is this expected? > Yes. This isn't a bug. It's actually a feature: there are cases where it's useful that we don't do semantics checking on statements until they are reached. A trivial example is begin

Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Bryn Llewellyn
> x...@thebuild.com wrote: > >> b...@yugabyte.com wrote: >> >> Is this expected? > > Yes. This isn't a bug… Database objects (such as tables and columns) are > left as identifiers until they are executed, because that is the point at > which a plan for those statements is created. The other

Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Christophe Pettus
> On Jul 28, 2022, at 18:04, Bryn Llewellyn wrote: > Is this expected? Yes. This isn't a bug. > In other words, is there a careful explanation of what "parse" means in the > context of "create or replace" for a subprogram that predicts all of the > outcomes that I reported here? Database

« The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Bryn Llewellyn
The subject line is copied from "PL/pgSQL under the Hood" (https://www.postgresql.org/docs/current/plpgsql-implementation.html). It implies the question: « What does the term "parse" mean? » I couldn't find more than what I quoted. Have I missed something? Anyway, I tried some tests. Here's an

Re: Syntax error when combining --set and --command has me stumped

2022-07-28 Thread Adrian Klaver
On 7/28/22 12:40, Ron wrote: $ alias psql12 alias psql12='/usr/lib/postgresql/12/bin/psql -p5433' This works ask expected: $ psql12 --set num=42 -ac "\echo :num" echo :num 42 And so does this: $ psql12 --set num=42 psql (12.11 (Ubuntu 12.11-1.pgdg18.04+1)) Type "help" for help. postgres=# s

Re: Syntax error when combining --set and --command has me stumped

2022-07-28 Thread Ron
On 7/28/22 14:47, David G. Johnston wrote: On Thu, Jul 28, 2022 at 12:40 PM Ron wrote: What secret sauce am I missing to get this to work? Given that the documentation says: "command must be either a command string that is completely parsable by the server (i.e., it contains no psql-spe

Re: Syntax error when combining --set and --command has me stumped

2022-07-28 Thread David G. Johnston
On Thu, Jul 28, 2022 at 12:40 PM Ron wrote: > What secret sauce am I missing to get this to work? > Given that the documentation says: "command must be either a command string that is completely parsable by the server (i.e., it contains no psql-specific features), or a single backslash command.

Syntax error when combining --set and --command has me stumped

2022-07-28 Thread Ron
$ alias psql12 alias psql12='/usr/lib/postgresql/12/bin/psql -p5433' This works ask expected: $ psql12 --set num=42 -ac "\echo :num" echo :num 42 And so does this: $ psql12 --set num=42 psql (12.11 (Ubuntu 12.11-1.pgdg18.04+1)) Type "help" for help. postgres=# select :num;  ?column? ---

Re: Was my question inappropriate for postgres?

2022-07-28 Thread Peter J. Holzer
On 2022-07-24 20:27:56 -0400, Mladen Gogala wrote: > On 7/24/22 19:56, Taka Taka wrote: > I would like to know if psqlodbc_13_02 is compatible with M365. > Also, could you please tell me which of the psqlodbc_13_02 would be > suitable to Windows 10 64-bit? > > What is M365? Is it a par

Re: Feature request(?): Proxy User

2022-07-28 Thread Alicja Kucharczyk
czw., 28 lip 2022 o 14:18 Mateusz Henicz napisał(a): > Hi, > Did you check "SET SESSION AUTHORIZATION" or "SET ROLE" commands? > I think that is what you are looking for. > > Cheers, > Mateusz > > czw., 28 lip 2022 o 11:29 Wiwwo Staff napisał(a): > >> Sorry to post solutions and links about alte

Re: pg_dump query failed

2022-07-28 Thread Tom Lane
karol.malinow...@trustedeyes.pl writes: > last week backup of my one database stops with error like below: > "pg_dump: [archiver (db)] query failed: server closed the connection > unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > Addi

Re: pg_dump query failed

2022-07-28 Thread Ron
On 7/28/22 05:08, karol.malinow...@trustedeyes.pl wrote: Hi all, last week backup of my one database stops with error like below: "pg_dump: [archiver (db)] query failed: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing

Re: Feature request(?): Proxy User

2022-07-28 Thread Mateusz Henicz
Hi, Did you check "SET SESSION AUTHORIZATION" or "SET ROLE" commands? I think that is what you are looking for. Cheers, Mateusz czw., 28 lip 2022 o 11:29 Wiwwo Staff napisał(a): > Sorry to post solutions and links about alternative DBMSs, but I miss this > sort of "sudo" ad database user level:

Re: pg_dump query failed

2022-07-28 Thread David G. Johnston
On Thursday, July 28, 2022, wrote: > Additional info: > > PostgreSQL 9.6.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 > 20150623 (Red Hat 4.8.5-16), 64-bit > > database size 220GB > > System CentOS 7 > > I am not sure how to recognize the problem. > Does the server log have more info?

pg_dump query failed

2022-07-28 Thread karol . malinowski
Hi all, last week backup of my one database stops with error like below: "pg_dump: [archiver (db)] query failed: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. pg_dump: [archiver (db)] query was: SELECT l.o

xmin of slot is not moving | hot standby feedback sending old xmin.

2022-07-28 Thread T T
Hi Team, *Issues :-* xmin of physical replication slot is not moving/hung, slave is refering/stuck on old xmin. which causes it to send old xmin to primary when hot_standby_feedback is on. *PG Version* :- 10.12 *Slot Details : - * postgres=# select * from pg_replication_slots ; slot_name

Feature request(?): Proxy User

2022-07-28 Thread Wiwwo Staff
Sorry to post solutions and links about alternative DBMSs, but I miss this sort of "sudo" ad database user level: https://oracle-base.com/articles/misc/proxy-users-and-connect-through Is there any approach to achieve the same result in Postgresql? Anyone sharing the need of this functionality? Tn

Re: Feature request: psql --idle

2022-07-28 Thread Wiwwo Staff
Thanks all for the alternative solutions. Yet, despite of my (wrong and misleading) use-case, I still share Julien's view of this being useful, whatever the parameter or the use-case. My 2 cents :-) On Wed, Jul 27, 2022 at 2:49 PM Wiwwo Staff wrote: > Since changing ph_hda.conf file to give us