Sv: How can I set up Postgres to use given amount of RAM?

2022-06-26 Thread Andreas Joseph Krogh


På søndag 26. juni 2022 kl. 20:40:01, skrev W.P. mailto:laure...@wp.pl>>:
Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables I run queries on?

As I can see disk actity running queries.


W.P..
The closest thing I can think of is effective_cache_size: 
https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE
 









--
Andreas Joseph Krogh


Re: Differences in Escaped bytea's when creating a plain pg_dump

2022-06-26 Thread WR

I'm back at my problem today:




Example:


postgres=# set standard_conforming_strings to off;
SET


postgres=# set escape_string_warning to off;
SET


postgres=# select '\000'::bytea;
ERROR:  invalid byte sequence for encoding "UTF8": 0x00


postgres=# select '\\000'::bytea;
 bytea 
---

 \x00
(1 row)


I made some test with pgadmin. Pgadmin (5.2) also reports this error 
now. And it doesn't matter if standard_conforming_strings is on or off.



SET standard_conforming_strings = off;

INSERT INTO public.oned_figures VALUES (1, 'Figure_Wolle1', 476, -476, 
2000, 2400, 2400, '\000', 500, 0, 'sinus(0|0|0;30;5;0;0,5;0)', 
'2021-08-31 11:53:22.442801', 0, 1);


And

SET standard_conforming_strings = on;

INSERT INTO public.oned_figures VALUES (1, 'Figure_Wolle1', 476, -476, 
2000, 2400, 2400, '\000', 500, 0, 'sinus(0|0|0;30;5;0;0,5;0)', 
'2021-08-31 11:53:22.442801', 0, 1);



Both do report:

WARNUNG:  nicht standardkonforme Verwendung von Escape in 
Zeichenkettenkonstante

LINE 8: ...(1, 'Figure_Wolle1', 476, -476, 2000, 2400, 2400, '\000\000&...
 ^
HINT:  Verwenden Sie die Syntax für Escape-Zeichenketten, z.B. E'\r\n'.

ERROR: FEHLER:  ungültige Byte-Sequenz für Kodierung »UTF8«: 0x00


The warning can be avoided by adding the E before the string constant.

The only solution to avoid the error is, to double-backslash.

INSERT INTO public.oned_figures VALUES (1, 'Figure_Wolle1', 476, -476, 
2000, 2400, 2400, E'\\000', 500, 0, 'sinus(0|0|0;30;5;0;0,5;0)', 
'2021-08-31 11:53:22.442801', 0, 1);


I also  dumped the table again after INSERT, and the data was correct 
(but again without E and with single backslash)


What I cant understand: why does pg_dump produce the string without the 
E and without double-backslash, when it is needed? Now I have to write a 
correction routine in c++, what fixes the dumps, before using them.



--
May the source be with you




Re: Postgresql error : PANIC: could not locate a valid checkpoint record

2022-06-26 Thread Michael Paquier
On Fri, Jun 24, 2022 at 01:03:57PM +, Mahendrakar, Prabhakar - Dell Team 
wrote:
> Is it possible to explicitly issue a checkpoint before we move on to
> the pg_upgrade command? 
> so that in the circumstances of the Upgrade issues (like PANIC:
> could not locate a valid checkpoint record), we still  have this
> last explicit checkpoint available. 
>
> Please let us know your thoughts on this.

Well, you have mentioned the use of pg_upgrade, but you are giving
zero details about what kind of command you used, how you handled
the clusters before and after that were upgraded, or what kind of
environment is getting used.  With this little amount of details,
nobody will be able to guess what's happening.  This issue could also
be caused by the environment.  For example, it is possible in some
carelessly-setup enviromnents that a flush is issued and recognized as
completed by the OS, and thought as completed by Postgres, but an
application layer between the OS and the actual hardware did not issue
the flush (be it an OS, FS, disk or a VM-related thing), which would
make this issue reachable.
--
Michael


signature.asc
Description: PGP signature


Re: How can I set up Postgres to use given amount of RAM?

2022-06-26 Thread Mladen Gogala

On 6/26/22 14:40, W.P. wrote:

Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 
2-3GB.


So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables  I run queries on?

As I can see disk actity running queries.


W.P..



I would try docker with --memory option. An alternative is to create a 
VM with the given amount of memory. If your laptop is memory starved, 
then creating a VM is probably not an option. Docker is much cheaper. 
Dockerfile is relatively simple to master and you can use Docker to run 
almost anything.


Regards

--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com


Re: How can I set up Postgres to use given amount of RAM?

2022-06-26 Thread Zahid Rahman
https://severalnines.com/database-blog/architecture-and-tuning-memory-postgresql-databases


On Sun, 26 Jun 2022, 11:40 pm W.P.,  wrote:

> Question in topic:
>
> "How can I set up Postgres to use given amount of RAM?"
>
> I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.
>
> So my question is how to FORCE PostgreSQL
>
> use let's say 2-4Ghow to B of RAM for caching tables  I run queries on?
>
> As I can see disk actity running queries.
>
>
> W.P..
>
>
>
>


How can I set up Postgres to use given amount of RAM?

2022-06-26 Thread W.P.

Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables  I run queries on?

As I can see disk actity running queries.


W.P..





Re: Question about attention to pgsql-hack...@lists.postgresql.org

2022-06-26 Thread Mladen Gogala

On 6/26/22 09:15, Julien Rouhaud wrote:

On top of that OP has already received a lot of answers in the past, it's just
that since no one wants to take care of a whole non trivial project for free
the answer is never what OP wants.


On top of that, most of the functionality can be obtained by using 
plpython3u and importing "numpy".


--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com


Re: Question about attention to pgsql-hack...@lists.postgresql.org

2022-06-26 Thread Julien Rouhaud
On Sun, Jun 26, 2022 at 01:22:49PM +0200, Laurenz Albe wrote:
> On Sun, 2022-06-26 at 10:37 +, A Z wrote:
> > I have successfully sent an (updated) email list message to 
> > 
> > pgsql-hack...@lists.postgresql.org
> > 
> > which can be viewed in the archive here:
> > 
> > https://www.postgresql.org/message-id/Rm7WBtZZpYL1NWuunuN_16EY0JcyejqV22z_JlUfvD5FYPenGDd_ZGUddwAcMNi2KNSyvqAhBRzj2JxtJoNmWAzykBQU4Z1AzBp0GPs8wZQ=@protonmail.com
> > 
> > I was wondering if anyone can or will pay some active attention to it?
> > i.e. what can I do from here to raise the message there to the attention 
> > of more people involved with pgsql-hackers, in order to get one or more 
> > active email replies in response to what I have posed/asked?
> 
> It is a long, winding e-mail, suggesting an extension for "high precision 
> arithmetic support".
> It is written in a way so that at least I cannot right away understand what 
> this is supposed
> to be, or how it does anything that "numeric" doesn't.
> 
> At the end of your e-mail, it turns out that you are looking for someone to 
> implement this
> not very well specified extension for you, for free.
> 
> I am not surprised that you got no response.  You'll have to write that 
> extension yourself
> or hire someone to do it for you (but then you should come up with a better 
> specification).

On top of that OP has already received a lot of answers in the past, it's just
that since no one wants to take care of a whole non trivial project for free
the answer is never what OP wants.

So I'm pretty sure that everyone on the list is well aware of what OP wants,
and keeping sending regular messages isn't going to help:

https://www.postgresql.org/message-id/psxp216mb0085760d0fca442a1d4974769a...@psxp216mb0085.korp216.prod.outlook.com
https://www.postgresql.org/message-id/psxp216mb0085b1c0b3e10a1cf3bcd1a09a...@psxp216mb0085.korp216.prod.outlook.com
https://www.postgresql.org/message-id/psxp216mb0085098a2d76e3c5dd4f8ae99a...@psxp216mb0085.korp216.prod.outlook.com
https://www.postgresql.org/message-id/psxp216mb0085f21467c36f05ab9427879a...@psxp216mb0085.korp216.prod.outlook.com
https://www.postgresql.org/message-id/psxp216mb0085ade313f9f48a134057f39a...@psxp216mb0085.korp216.prod.outlook.com
https://www.postgresql.org/message-id/psxp216mb0085d05d015de0c46a11be1f9a...@psxp216mb0085.korp216.prod.outlook.com

I also received 2 private emails for the same project, one of which containing
*a lot* of other people.




Re: Question about attention to pgsql-hack...@lists.postgresql.org

2022-06-26 Thread Laurenz Albe
On Sun, 2022-06-26 at 10:37 +, A Z wrote:
> I have successfully sent an (updated) email list message to 
> 
> pgsql-hack...@lists.postgresql.org
> 
> which can be viewed in the archive here:
> 
> https://www.postgresql.org/message-id/Rm7WBtZZpYL1NWuunuN_16EY0JcyejqV22z_JlUfvD5FYPenGDd_ZGUddwAcMNi2KNSyvqAhBRzj2JxtJoNmWAzykBQU4Z1AzBp0GPs8wZQ=@protonmail.com
> 
> I was wondering if anyone can or will pay some active attention to it?
> i.e. what can I do from here to raise the message there to the attention 
> of more people involved with pgsql-hackers, in order to get one or more 
> active email replies in response to what I have posed/asked?

It is a long, winding e-mail, suggesting an extension for "high precision 
arithmetic support".
It is written in a way so that at least I cannot right away understand what 
this is supposed
to be, or how it does anything that "numeric" doesn't.

At the end of your e-mail, it turns out that you are looking for someone to 
implement this
not very well specified extension for you, for free.

I am not surprised that you got no response.  You'll have to write that 
extension yourself
or hire someone to do it for you (but then you should come up with a better 
specification).

Yours,
Laurenz Albe




Question about attention to pgsql-hack...@lists.postgresql.org

2022-06-26 Thread A Z
Dear pgsql-general,

I have successfully sent an (updated) email list message to

pgsql-hack...@lists.postgresql.org

which can be viewed in the archive here:

https://www.postgresql.org/message-id/Rm7WBtZZpYL1NWuunuN_16EY0JcyejqV22z_JlUfvD5FYPenGDd_ZGUddwAcMNi2KNSyvqAhBRzj2JxtJoNmWAzykBQU4Z1AzBp0GPs8wZQ=@protonmail.com

I was wondering if anyone can or will pay some active attention to it?
i.e. what can I do from here to raise the message there to the attention
of more people involved with pgsql-hackers, in order to get one or more
active email replies in response to what I have posed/asked?

My email address is powerus...@live.com.au,

and my online name for the post is

Sergio Minervini.