Re: Using a 'loopback' FDW

2021-03-09 Thread Steve Baldwin
Thanks so much Tom. That was indeed the problem. In hindsight the error information makes perfect sense (at least after reading the docs on pg_hba.conf). Regards, Steve On Wed, Mar 10, 2021 at 3:04 PM Steve Baldwin wrote: > Thanks Tom. I'm running postgres from the standard alpine docker

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Alvaro Herrera
On 2021-Mar-10, Vincent Veyron wrote: > On Tue, 09 Mar 2021 16:22:07 -0500 > Tom Lane wrote: > > (I suppose you could also use regexp_replace to convert random forms > > of whitespace to plain ASCII space.) > > No dice. 'G' formatting looks like a whitespace, but is different (it > appears to

Re: Using a 'loopback' FDW

2021-03-09 Thread Steve Baldwin
Thanks Tom. I'm running postgres from the standard alpine docker container and haven't changed that file. I'm not at my laptop ATM but will check it out when I get home. Cheers, Steve On Wed, 10 Mar 2021, 14:42 Tom Lane, wrote: > Steve Baldwin writes: > > I'm guessing I'm doing something wrong

Re: Using a 'loopback' FDW

2021-03-09 Thread Tom Lane
Steve Baldwin writes: > I'm guessing I'm doing something wrong here. I've used postgres_fdw before > to connect between servers, but in this instance I'm trying to use it > to connect back to itself. What are your pg_hba.conf settings for local connections? > ERROR: password is required >

Using a 'loopback' FDW

2021-03-09 Thread Steve Baldwin
I'm guessing I'm doing something wrong here. I've used postgres_fdw before to connect between servers, but in this instance I'm trying to use it to connect back to itself. (This is postgres 13.2) In my local DB have a user 'slaw_owner' which has a password of 'password'. This user has been

Logical Replication, CPU load and Locking contention

2021-03-09 Thread Martín Fernández
Hello, I’m troubleshooting a problem at my company with a pg 12 cluster that we run. We are using Amazon DMS to replicate data from our database into S3 buckets. DMS replicates data by using logical replication slots. After introducing DMS in our environment, we have seen an increase in CPU

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Mar 9, 2021 at 4:50 PM Tom Lane wrote: >> Would it be better >> to turn the para into a bulleted list, which we could introduce with >> "The key differences are:" ? > Indeed, reworking the rest of the paragraph around that introduction would > be much

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Tom Lane
Vincent Veyron writes: > Tom Lane wrote: >> (I suppose you could also use regexp_replace to convert random forms >> of whitespace to plain ASCII space.) > No dice. 'G' formatting looks like a whitespace, but is different (it appears > to be slightly narrower when displayed in html, too) :

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread David G. Johnston
On Tue, Mar 9, 2021 at 4:50 PM Tom Lane wrote: > I very strongly dislike the existing "The difference ..." wording, > because it implies that that's the only difference, which is immediately > belied by the rest. Agreed! > Would it be better > to turn the para into a bulleted list, which we

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Mar 9, 2021 at 3:21 PM Tom Lane wrote: >> "David G. Johnston" writes: >>> Instead of "The difference" or "One difference" I would suggest: >>> "However, a procedure does not return a value, so there is no return type >>> declaration; though a procedure can

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread David G. Johnston
On Tue, Mar 9, 2021 at 3:21 PM Tom Lane wrote: > "David G. Johnston" writes: > > The omission of the "OUT" parameter mode seems intentional since at > present > > our procedures do not support OUT mode parameters. > > Um, I just created one. I think this *used* to be true, and this bit of >

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Rob Sargent
On 3/9/21 4:03 PM, Vincent Veyron wrote: No dice. 'G' formatting looks like a whitespace, but is different (it appears to be slightly narrower when displayed in html, too) : An "n-space", no?

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Vincent Veyron
On Tue, 09 Mar 2021 16:22:07 -0500 Tom Lane wrote: > The point here is that 'G' and related format codes act as specified by > your LC_MONETARY locale. If you don't like the results, you need to use > a different locale. This is a numeric(10,2) type field though. I tried casting it to money

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread Tom Lane
"David G. Johnston" writes: > The omission of the "OUT" parameter mode seems intentional since at present > our procedures do not support OUT mode parameters. Um, I just created one. I think this *used* to be true, and this bit of the docs didn't get fixed. If I back-patch this, I'll have to

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread David G. Johnston
On Tue, Mar 9, 2021 at 1:57 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Mon, Mar 8, 2021 at 9:41 PM Tom Lane wrote: > >> Guyren Howe writes: > >>> This seems like an important consideration. I've spent 10 minutes > >>> searching the documentation for PG 11 and can't find where it

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Rob Sargent
On 3/9/21 2:22 PM, Tom Lane wrote: Vincent Veyron writes: Having a database with the proper lc_numeric setting for each country, and using to_char/to_number to manipulate numbers is much more appealing than writing my own parser in my front end. But this weird space is getting in my way.

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Tom Lane
Vincent Veyron writes: > Having a database with the proper lc_numeric setting for each country, and > using to_char/to_number to manipulate numbers is much more appealing than > writing my own parser in my front end. But this weird space is getting in my > way. The point here is that 'G' and

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Vincent Veyron
On Tue, 9 Mar 2021 13:33:19 -0700 "David G. Johnston" wrote: > > By using "G" you are giving up control and letting your locale settings > decide what gets output. You can continue to use to_char but take control > back by being explicit, or pass actual numbers into and out of the database >

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread Tom Lane
"David G. Johnston" writes: > On Mon, Mar 8, 2021 at 9:41 PM Tom Lane wrote: >> Guyren Howe writes: >>> This seems like an important consideration. I've spent 10 minutes >>> searching the documentation for PG 11 and can't find where it is >>> documented. Perhaps it should be made more

Re: unexpected character used as group separator by to_char

2021-03-09 Thread David G. Johnston
On Tue, Mar 9, 2021 at 1:28 PM Vincent Veyron wrote: > For the record below, I wish to display 'credit' properly formated in an > html form, using to_char(credit, 'FM999G990D00') > > ^ > What can I do to get a standard space as group separator for

unexpected character used as group separator by to_char

2021-03-09 Thread Vincent Veyron
Hi, I'm having a problem with to_char() inserting unexpected characters as group separator. For the record below, I wish to display 'credit' properly formated in an html form, using to_char(credit, 'FM999G990D00') SELECT *, to_char(credit, 'FM999G990D00') as yo from tblprospect_balance where

Re: how to limit statement memory allocation

2021-03-09 Thread Tom Lane
Radoslav Nedyalkov writes: > On Tue, Mar 9, 2021 at 6:53 PM Tom Lane wrote: >> The only thing I'm aware of that could consume unbounded memory >> on the server side is hash aggregation. (v13 has improved that >> situation, but I'm guessing you are running some older version.) >> The planner

Re: how to limit statement memory allocation

2021-03-09 Thread Radoslav Nedyalkov
On Tue, Mar 9, 2021 at 6:53 PM Tom Lane wrote: > Radoslav Nedyalkov writes: > > On Tue, Mar 9, 2021 at 6:03 PM Tom Lane wrote: > >> Perhaps the accumulation is happening on the client side? libpq doesn't > >> have any provision for spilling a result set to disk. > > > Ah, I named it result

Re: how to limit statement memory allocation

2021-03-09 Thread Tom Lane
Radoslav Nedyalkov writes: > On Tue, Mar 9, 2021 at 6:03 PM Tom Lane wrote: >> Perhaps the accumulation is happening on the client side? libpq doesn't >> have any provision for spilling a result set to disk. > Ah, I named it result set wrongly perhaps. > These are queries , part of a larger

Re: how to limit statement memory allocation

2021-03-09 Thread Radoslav Nedyalkov
On Tue, Mar 9, 2021 at 6:03 PM Tom Lane wrote: > Radoslav Nedyalkov writes: > > Occasionally we get bad queries on our db that consume a lot of memory. > > These typically are full joins by mistake or just too large result sets. > > My understanding is these should go to a temp file but

Re: how to limit statement memory allocation

2021-03-09 Thread Tom Lane
Radoslav Nedyalkov writes: > Occasionally we get bad queries on our db that consume a lot of memory. > These typically are full joins by mistake or just too large result sets. > My understanding is these should go to a temp file but apparently memory > allocation is preferred. Perhaps the

how to limit statement memory allocation

2021-03-09 Thread Radoslav Nedyalkov
Hi all, Occasionally we get bad queries on our db that consume a lot of memory. These typically are full joins by mistake or just too large result sets. My understanding is these should go to a temp file but apparently memory allocation is preferred. Last time a statement hit 150GB RAM and did

Re: Stored function RETURNS table, but in some cases columns are missing - should I set them to NULL?

2021-03-09 Thread Alexander Farber
Tom, you are so eagle eyed - On Mon, Mar 8, 2021 at 8:53 PM Tom Lane wrote: > Alexander Farber writes: > > However there are cases, when I only have the out_gid value, I do not > want > > to return any other values. > > My question is: do I have to set the other OUT params explicitly to NULL?

Re: Question about when PostgreSQL 11.0 was released

2021-03-09 Thread Joe Conway
On 3/9/21 8:20 AM, Greg Sabino Mullane wrote: > Ram Bysani asked: >> I am not finding the release cadence for the PostgreSQL databases. >> Please let me know how I can find the base and dot version release dates for: > > You can see all the release dates on one page here: > >

Re: PostgreSQL container crash trouble.

2021-03-09 Thread Daisuke Ikeda
Thank you for your reply! It was helpful. I'll check more about the state of writing on the disk storage. And I will reinforce the backup & restore strategy. 2021年3月9日(火) 0:28 Laurenz Albe : > On Mon, 2021-03-08 at 22:30 +0900, Daisuke Ikeda wrote: > > I'm running PostgreSQL (enabled

Re: Question about when PostgreSQL 11.0 was released

2021-03-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ram Bysani asked: > I am not finding the release cadence for the PostgreSQL databases. > Please let me know how I can find the base and dot version release dates for: You can see all the release dates on one page here:

jsonpath with @@ and iterating over arrays

2021-03-09 Thread Thomas Kellerer
I have a question regarding the processing of arrays when using the "short jsonpath" with the @@ operator. E.g. when trying to "translate" this jsonpath where jsonb_path_exists(the_column, '$[*] ? (@.id == 42 && @.type == "foo")') to be used with the @@ operator, then the "? (...)" cannot

Re: Log files polluted with permission denied error messages after every 10 seconds

2021-03-09 Thread Thomas Kellerer
Andrus schrieb am 05.03.2021 um 18:36: > Hi! > >>Windows? Don't let anti-virus software mess with the data directory. > > Windows default Windows Defender is active. I excluded data, pg_wal folders > and postgres process: > > > Then turned real-time protection off: > > Problem persists. New

Re: SV: Log files polluted with permission denied error messages after every 10 seconds

2021-03-09 Thread Thomas Munro
On Tue, Mar 9, 2021 at 9:43 PM Andrus wrote: > > Any hints in Windows event viewer? Events occurring at the same time > showing up there. > > Looked into Administrative Events/Custom views and few others. There are no > messages about this. Windowsi perfomance monitor and Filemon show files >

curious cost vs execution time (local test)

2021-03-09 Thread Wim Bertels
Hello, Using the chinook database https://github.com/lerocha/chinook-database/blob/master/ChinookDatabase/DataSources/Chinook_PostgreSql.sql locally, so there should be little side-effects (network, host, cache..) for the following two equivalent queries, the cost and execution times are curious.

Re: Import data from one instance another

2021-03-09 Thread Wim Bertels
Hello Rama, not quiet sure what the question is, you can choose the name of the foreign table https://www.postgresql.org/docs/current/postgres-fdw.html Rama Krishnan schreef op di 09-03-2021 om 14:47 [+0530]: > Hi Team, > > I have two instances called A and B, in A instances I have one table >

Import data from one instance another

2021-03-09 Thread Rama Krishnan
Hi Team, I have two instances called A and B, in A instances I have one table name called sports I want to import data from A into B instances I found foreign data wrapper is the best solution when the table is huge here I have doubt is it foreign data wrapper and foreign tables are same?

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-09 Thread Brent Wood
They are discussed here, https://kb.objectrocket.com/postgresql/function-vs-stored-procedure-602 (from this page): The main difference between function and stored procedure is that user-defined functions do not execute transactions. This means, inside a given function you cannot open a new

Re: SV: Log files polluted with permission denied error messages after every 10 seconds

2021-03-09 Thread Andrus
Any hints in Windows event viewer? Events occurring at the same time showing up there. Looked into Administrative Events/Custom views and few others. There are no messages about this. Windowsi perfomance monitor and Filemon show files opened by process. How to do reverse: log processes