default icu locale for new databases (PG15)

2023-01-12 Thread Robert Sjöblom
Greetings, When initializing a new database server with a default collation, there are a number of different locales available. What's the difference between 1. se-x-icu 2. se-SE-x-icu 3. sv-SE-x-icu ? And, perhaps more importantly, how do I future-proof this so that I'm not making a

Re: AW: [Extern] Re: postgres restore & needed history files

2023-01-12 Thread Ron
On 1/12/23 10:50, Zwettler Markus (OIZ) wrote: [snip] What would you do in case of a disaster when all history files in pg_wal are gone and also deleted in the backup due to the backup retention? Yet another reason why you should not roll your own PITR backup solution.  Use something like

Re: Changing displayed time zone in RAISE NOTICE output?

2023-01-12 Thread Pavel Stehule
čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver napsal: > On 1/11/23 21:25, Ron wrote: > > On 1/11/23 15:06, Adrian Klaver wrote: > > > > > Hmm. I'd have sworn this didn't work when I tried it: > > Did you do?: > > DO $$ > BEGIN > RAISE NOTICE '%', clock_timestamp() at timezone 'UTC'; > END$$;

Re: Changing displayed time zone in RAISE NOTICE output?

2023-01-12 Thread Pavel Stehule
čt 12. 1. 2023 v 17:27 odesílatel Adrian Klaver napsal: > On 1/12/23 08:22, Pavel Stehule wrote: > > > > > > čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver > > mailto:adrian.kla...@aklaver.com>> napsal: > > > > On 1/11/23 21:25, Ron wrote: > > > On 1/11/23 15:06, Adrian Klaver wrote: >

AW: [Extern] Re: postgres restore & needed history files

2023-01-12 Thread Zwettler Markus (OIZ)
> -Ursprüngliche Nachricht- > Von: Laurenz Albe > Gesendet: Freitag, 6. Januar 2023 06:28 > An: Zwettler Markus (OIZ) ; pgsql- > gene...@lists.postgresql.org > Betreff: [Extern] Re: postgres restore & needed history files > > On Tue, 2023-01-03 at 16:03 +, Zwettler Markus (OIZ)

Re: Changing displayed time zone in RAISE NOTICE output?

2023-01-12 Thread Adrian Klaver
On 1/11/23 21:25, Ron wrote: On 1/11/23 15:06, Adrian Klaver wrote: Hmm.  I'd have sworn this didn't work when I tried it: Did you do?: DO $$ BEGIN RAISE NOTICE '%', clock_timestamp() at timezone 'UTC'; END$$; ERROR: syntax error at or near "timezone" LINE 3: RAISE NOTICE '%',

Intervals and ISO 8601 duration

2023-01-12 Thread Sebastien Flaesch
PostgreSQL has the INTERVAL type, which can be defined with fields such as: INTERVAL YEAR TO MONTH(year-month class) INTERVAL DAY TO SECOND(p) (day-second class) It's not possible to define an INTERVAL YEAR TO SECOND(p), which makes sense, since the number of days in a month can vary.

Re: Intervals and ISO 8601 duration

2023-01-12 Thread Tom Lane
Sebastien Flaesch writes: > PostgreSQL has the INTERVAL type, which can be defined with fields such as: > INTERVAL YEAR TO MONTH(year-month class) > INTERVAL DAY TO SECOND(p) (day-second class) You can also say just INTERVAL, without any of the restrictions. > It's not possible to define

Re: default icu locale for new databases (PG15)

2023-01-12 Thread Laurenz Albe
On Thu, 2023-01-12 at 15:56 +0100, Robert Sjöblom wrote: > When initializing a new database server with a default collation, there > are a number of different locales available. What's the difference between > > 1. se-x-icu > 2. se-SE-x-icu > 3. sv-SE-x-icu > > ? And, perhaps more importantly,

Re: Changing displayed time zone in RAISE NOTICE output?

2023-01-12 Thread Adrian Klaver
On 1/12/23 08:22, Pavel Stehule wrote: čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver mailto:adrian.kla...@aklaver.com>> napsal: On 1/11/23 21:25, Ron wrote: > On 1/11/23 15:06, Adrian Klaver wrote: > > Hmm.  I'd have sworn this didn't work when I tried it: Did you

Re: Why is a hash join preferred when it does not fit in work_mem

2023-01-12 Thread David Rowley
On Fri, 13 Jan 2023 at 07:33, Dimitrios Apostolou wrote: > > I have a very simple NATURAL JOIN that does not fit in the work_mem. Why > does the query planner prefer a hash join that needs 361s, while with a > sort operation and a merge join it takes only 13s? It's a simple matter of that the

gexec from command prompt?

2023-01-12 Thread Ron
Postgresql 12.11 This might be more of a bash question, or it might be a psql vs engine problem. I want to run this query using psql from a bash prompt: select format('SELECT ''%s'', MIN(part_date) FROM %s;', table_name, table_name) from dba.table_structure order by table_name\gexec Thus, I

Re: gexec from command prompt?

2023-01-12 Thread Pavel Stehule
čt 12. 1. 2023 v 18:25 odesílatel Ron napsal: > Postgresql 12.11 > > This might be more of a bash question, or it might be a psql vs engine > problem. > > I want to run this query using psql from a bash prompt: > select format('SELECT ''%s'', MIN(part_date) FROM %s;', table_name, > table_name) >

Why is a hash join preferred when it does not fit in work_mem

2023-01-12 Thread Dimitrios Apostolou
Hello list, I have a very simple NATURAL JOIN that does not fit in the work_mem. Why does the query planner prefer a hash join that needs 361s, while with a sort operation and a merge join it takes only 13s? The server is an old Mac Mini with hard disk drive and only 4GB RAM. Postgres version

Re: gexec from command prompt?

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 10:34 AM Pavel Stehule wrote: > > čt 12. 1. 2023 v 18:25 odesílatel Ron napsal: > >> >> Removing "\\exec" from the statement, and appending -c "\\gexec" to the >> psql >> command technically worked, but did not run the commands. >> > > I don't know why, but \g* commands

Re: gexec from command prompt?

2023-01-12 Thread Alvaro Herrera
On 2023-Jan-12, Ron wrote: > Postgresql 12.11 > > This might be more of a bash question, or it might be a psql vs engine > problem. > > I want to run this query using psql from a bash prompt: > select format('SELECT ''%s'', MIN(part_date) FROM %s;', table_name, > table_name) > from