Feature-Request: Performance-Optimization when using limit in combination with order by on querys using union

2025-05-08 Thread Karsten P

Hi,

i've already googled so far but didn't find anything regarding my problem..
I hope i'm here at the right place.

Following situation (this is just an simplyfied example):

suppose we have two tables, lets say

orders
  - column 'order_number' -> varchar
  - column 'order_date' -> timestamp

with index on order_date

and

invoices
  - column 'invoice_number' -> varchar
  - column 'invoice_date' -> timestamp

with index on invoice_date

and many records in both if them.

now we have a view combining both of them as

create view documents as
(
    select order_number as document_number, order_date as document_date 
from orders

    union all select invoice_number, invoice_date from invoices
)


finding the last order placed in the database ist really easy:

  select order_number from orders order by order_date desc limit 1

will result in an index scan backward on orders

same with invoices only...

but when querying the view

  select document_number from documents order by document_date desc limit 1

seems to break down to
  - collect all rows from orders
  - combine it with all rows from invoices
  - sort all rows (descending)
  - limit to one row

with many data this is quite slow.

I've tested this with PG9.6 and PG14, it doesn't seem to make a 
difference (correct me if i'm wrong).



So my question is: What about optimizing the query-planner that if

- a query with unions of selects is executed
- and an 'order by' in combination with 'limit' is applied on the 
complete query (not only on subselects)

- and there is a matching index for each select

the order by and limit - part of the sql is also beeing applied on each 
sub-select ?


actually
    select document_number from documents order by document_date desc 
limit 1


is beeing processed as
    select order_number from orders
    union all select invoice_number from invoices
    order by document_number desc
    limit 1

but would it be possible to let the query-optimizer expand the query to
    select order_number from (
        (select order_number, order_date from orders order by 
order_date desc limit 1)
        union all (select invoice_number, invoice_date from invoices 
order by invoice_date desc limit 1)

    ) as subselect
   order by order_date desc
   limit 1

as this would use two (or number of unions) index-backward-scans
and than only has to reorder at maximum two rows before limiting to the 
first of it?


this should be significantly faster.

thanks a lot and greetz,
Karsten





Re: Feature-Request: Performance-Optimization when using limit in combination with order by on querys using union

2025-05-08 Thread Karsten P

Okay, forget what i've just written, sorry for that.

I've digged deeper and checked my generic example - it works perfectly using
a merge-append in combination with limit.

i'm sorry i didn't check that first. it just won't work in my real-life 
example.
though each part of the query is using an index-scan it is than using a 
'normal' append

instead of a merge-append, but i don't know why.

here is the expected query plan as used with my generic example:

Limit  (cost=0.86..0.90 rows=1 width=12)
  ->  Merge Append  (cost=0.86..104314.37 rows=3435900 width=12)
    Sort Key: kpkp_orders.buchungsdatum DESC
    ->  Index Only Scan Backward using kpkp_orders_1 on 
kpkp_orders  (cost=0.43..34977.68 rows=1717950 width=12)
    ->  Index Only Scan Backward using kpkp_invoices_1 on 
kpkp_invoices  (cost=0.43..34977.68 rows=1717950 width=12)


this is fast.

and here is the query plan used on my real-life example:


Limit  (cost=918.40..918.41 rows=1 width=8)
  ->  Sort  (cost=918.40..919.59 rows=473 width=8)
    Sort Key: s.belegdatum DESC
    ->  Subquery Scan on s  (cost=0.56..916.04 rows=473 width=8)
  ->  Append  (cost=0.56..911.31 rows=473 width=327)
    ->  Subquery Scan on "*SELECT* 1" 
(cost=0.56..624.08 rows=318 width=187)
  ->  Index Scan using 
soit_erpprozesshistorie_12 on erpprozesshistorie eph (cost=0.56..620.10 
rows=318 width=181)
    Index Cond: ((clientid = '0'::numeric) 
AND (activeflag = 't'::bpchar) AND (prozessuntertyp = 2) AND (CASE WHEN 
((typ = 1) OR (typ = 7)) THEN 1 ELSE CASE WHEN (typ = 3) THEN 2 ELSE 
CASE WHEN ((typ = 4) OR (typ = 9)) THEN 3 ELSE 4 END END END = 1) AND 
(CASE WHEN (prozesstyp = 1) THEN true ELSE false END = true) AND 
(artikelvariante_objid = '1064748816'::numeric))
    ->  Subquery Scan on "*SELECT* 2" 
(cost=0.43..284.87 rows=155 width=214)
  ->  Index Scan using soit_umsatz_alt_08 on 
umsatz_alt  (cost=0.43..282.93 rows=155 width=186)
    Index Cond: ((clientid = '0'::numeric) 
AND (activeflag = 't'::bpchar) AND (verkauf = true) AND 
(artikelvariante_objid = '1064748816'::numeric))



so my question is: under wich circumstance does the query-planner use or 
prefer the 'merge append' over 'append'?



Thanks in advance!


Am 08.05.25 um 11:57 schrieb Karsten P:

Hi,

i've already googled so far but didn't find anything regarding my 
problem..

I hope i'm here at the right place.

Following situation (this is just an simplyfied example):

suppose we have two tables, lets say

orders
  - column 'order_number' -> varchar
  - column 'order_date' -> timestamp

with index on order_date

and

invoices
  - column 'invoice_number' -> varchar
  - column 'invoice_date' -> timestamp

with index on invoice_date

and many records in both if them.

now we have a view combining both of them as

create view documents as
(
    select order_number as document_number, order_date as 
document_date from orders

    union all select invoice_number, invoice_date from invoices
)


finding the last order placed in the database ist really easy:

  select order_number from orders order by order_date desc limit 1

will result in an index scan backward on orders

same with invoices only...

but when querying the view

  select document_number from documents order by document_date desc 
limit 1


seems to break down to
  - collect all rows from orders
  - combine it with all rows from invoices
  - sort all rows (descending)
  - limit to one row

with many data this is quite slow.

I've tested this with PG9.6 and PG14, it doesn't seem to make a 
difference (correct me if i'm wrong).



So my question is: What about optimizing the query-planner that if

- a query with unions of selects is executed
- and an 'order by' in combination with 'limit' is applied on the 
complete query (not only on subselects)

- and there is a matching index for each select

the order by and limit - part of the sql is also beeing applied on 
each sub-select ?


actually
    select document_number from documents order by document_date desc 
limit 1


is beeing processed as
    select order_number from orders
    union all select invoice_number from invoices
    order by document_number desc
    limit 1

but would it be possible to let the query-optimizer expand the query to
    select order_number from (
        (select order_number, order_date from orders order by 
order_date desc limit 1)
        union all (select invoice_number, invoice_date from invoices 
order by invoice_date desc limit 1)

    ) as subselect
   order by order_date desc
   limit 1

as this would use two (or number of unions) index-backward-scans
and than only has to reorder at maximum two rows before limiting to 
the first of it?


this should be significantly faster.

thanks a lot and greetz,
Karsten









Re: Pgbackrest failure for INCR and DIFF but not FULL backup

2025-05-08 Thread KK CHN
On Wed, May 7, 2025 at 6:46 PM Greg Sabino Mullane 
wrote:

> On Wed, May 7, 2025 at 7:15 AM KK CHN  wrote:
>
>> *archive_command = 'pgbackrest --stanza=My_Repo archive-push %p && cp %p
>> /data/archive/%f' *
>>
>
> Don't do this. You are archiving twice, and worse, the first part is using
> async archiving. Remove that whole "cp" part. Once that is fixed, run:
>

I'm going to see if putting   *archive_command = 'pgbackrest
--stanza=My_Repo archive-push %p'   *fix the problem.  This was haunting me
for more than a week.

Thanks for the suggestion.


> pgbackrest --stanza=My_Repo check
>
> to verify that WAL is being archived quickly and properly. Then test your
> backups, checking the file
> /var/log/pgbackrest/My_Repo-archive-push-async.log and your postgres log if
> any problems arise.
>
> Thanks .
Krishane


Cheers,
> Greg
>
> --
> Crunchy Data - https://www.crunchydata.com
> Enterprise Postgres Software Products & Tech Support
>
>


Re: pg_rewind problem: cannot find WAL

2025-05-08 Thread Luca Ferrari
On Thu, May 8, 2025 at 8:54 AM Luca Ferrari  wrote:
>
> I've pgbackrest making backups, so I have an archive_command. I'm
> going to see if putting a restore_command can fix the problem.
>

But I'm facing a quite trivial problem: in ubuntu installation the
configuration files are separated from the PGDATA.
Apparently pg_rewind is trying to read postgresql.conf to get the
restore_command, and I don't know how to specify the different
location of the postgresql.conf (cannot specifcy -c as in postgres):

$ /usr/lib/postgresql/17/bin/pg_rewind -D /var/lib/postgresql/17/main
--source-server="user=replica_fluca host=dev-psqlha3
dbname=replica_fluca" -R -P --debug -c
postgres: could not access the server configuration file
"/var/lib/postgresql/17/main/postgresql.conf": No such file or
directory
no data was returned by command "/usr/lib/postgresql/17/bin/postgres
-D /var/lib/postgresql/17/main -C restore_command"
child process exited with exit code 2
pg_rewind: error: could not read restore_command from target cluster

Any idea?
Clearly, postgresql.auto.conf is within PGDATA, and since my
recovery_command is there, one trick could be to touch and empty
PGDATA/postgresql.conf, pg_rewind, remove the fake configurtion file.
But I'm sure there is a smarter solution.

Thanks,
Luca




Re: Is anyone up for hosting the online PG game "Schemaverse"?

2025-05-08 Thread Justin Clift

On 2025-05-06 09:15, Merlin Moncure wrote:
On Thu, May 1, 2025 at 5:23 PM Justin Clift  
wrote:



Hi all,

The PostgreSQL game "Schemaverse" was removed from the PostgreSQL
website's
links a few months ago because it no longer had hosting.

Does anyone around have spare server/vm/something that could be used 
to

host it (for free)?


I might be interested.  Is it difficult to set up?


Definitely more a question for Josh (CC'd) than me.

Josh, are you ok to discuss this with Merlin (etc)?

+ Justin




Re: pg_rewind problem: cannot find WAL

2025-05-08 Thread Rob Sargent


> 
> Any idea?
> Clearly, postgresql.auto.conf is within PGDATA, and since my
> recovery_command is there, one trick could be to touch and empty
> PGDATA/postgresql.conf, pg_rewind, remove the fake configurtion file.
> But I'm sure there is a smarter solution.
> 
> Thanks,
> Luca
> 
> 
A symlink from $PGDATA to where actual file?





Re: pg_rewind problem: cannot find WAL

2025-05-08 Thread Adrian Klaver

On 5/8/25 04:26, Luca Ferrari wrote:

On Thu, May 8, 2025 at 8:54 AM Luca Ferrari  wrote:


I've pgbackrest making backups, so I have an archive_command. I'm
going to see if putting a restore_command can fix the problem.



But I'm facing a quite trivial problem: in ubuntu installation the
configuration files are separated from the PGDATA.
Apparently pg_rewind is trying to read postgresql.conf to get the
restore_command, and I don't know how to specify the different
location of the postgresql.conf (cannot specifcy -c as in postgres):

$ /usr/lib/postgresql/17/bin/pg_rewind -D /var/lib/postgresql/17/main
--source-server="user=replica_fluca host=dev-psqlha3
dbname=replica_fluca" -R -P --debug -c
postgres: could not access the server configuration file
"/var/lib/postgresql/17/main/postgresql.conf": No such file or
directory
no data was returned by command "/usr/lib/postgresql/17/bin/postgres
-D /var/lib/postgresql/17/main -C restore_command"
child process exited with exit code 2
pg_rewind: error: could not read restore_command from target cluster

Any idea?


/usr/lib/postgresql/17/bin/pg_rewind  --help
pg_rewind resynchronizes a PostgreSQL cluster with another copy of the 
cluster.


Usage:
  pg_rewind [OPTION]...

Options:
  -c, --restore-target-wal   use "restore_command" in target 
configuration to

 retrieve WAL files from archives
  -D, --target-pgdata=DIRECTORY  existing data directory to modify
  --source-pgdata=DIRECTORY  source data directory to synchronize with
  --source-server=CONNSTRsource server to synchronize with
  -n, --dry-run  stop before modifying anything
  -N, --no-sync  do not wait for changes to be written
 safely to disk
  -P, --progress write progress messages
  -R, --write-recovery-conf  write configuration for replication
 (requires --source-server)
  --config-file=FILENAME use specified main server configuration
 file when running target cluster
  --debugwrite a lot of debug messages
  --no-ensure-shutdown   do not automatically fix unclean shutdown
  --sync-method=METHOD   set method for syncing files to disk
  -V, --version  output version information, then exit
  -?, --help show this help, then exit


So use --config-file=FILENAME?


Clearly, postgresql.auto.conf is within PGDATA, and since my
recovery_command is there, one trick could be to touch and empty
PGDATA/postgresql.conf, pg_rewind, remove the fake configurtion file.
But I'm sure there is a smarter solution.

Thanks,
Luca




--
Adrian Klaver
adrian.kla...@aklaver.com





EDB Download for PostgreSQL 17.5 is broken

2025-05-08 Thread Ertan Küçükoglu
Hello,

I am just writing here with the hope that there are some EDB contacts here.

The 17.5 version Windows x86-64 download link on EDB is
https://sbp.enterprisedb.com/getfile.jsp?fileid=1259563 and this is
actually getting you a 17.4-2 download.

Thanks & Regards,
Ertan


Re: EDB Download for PostgreSQL 17.5 is broken

2025-05-08 Thread Adrian Klaver

On 5/8/25 09:29, Ertan Küçükoglu wrote:

Hello,

I am just writing here with the hope that there are some EDB contacts here.

The 17.5 version Windows x86-64 download link on EDB is 
https://sbp.enterprisedb.com/getfile.jsp?fileid=1259563 
 and this is 
actually getting you a 17.4-2 download.


When I click on the link I above I get 17.5-1.

When I click through from here:

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

I get 17.4-2.

Looks like some sort of caching issue.


Thanks & Regards,
Ertan


--
Adrian Klaver
adrian.kla...@aklaver.com





Re: Feature-Request: Performance-Optimization when using limit in combination with order by on querys using union

2025-05-08 Thread David Rowley
On Thu, 8 May 2025 at 22:57, Karsten P  wrote:
> i'm sorry i didn't check that first. it just won't work in my real-life
> example.
> though each part of the query is using an index-scan it is than using a
> 'normal' append
> instead of a merge-append, but i don't know why.

You could try:

SET enable_sort = 0;

... to see what the costs come out to be and how it performs. Perhaps
the planner thinks using the other indexes to more efficiently filter
out the unrelated tuples for the WHERE clause is cheaper than using
the index that provides the tuples sorted by date and filtering the
unwanted tuples with a "Filter".

> so my question is: under wich circumstance does the query-planner use or
> prefer the 'merge append' over 'append'?

It's all based on costs. Those are shown in the "cost=918.40..918.41"
part that you're seeing in the EXPLAIN output.

You could try adding an index that suits all your equality WHERE
clause filters, or some subset of them and put the date column as the
final indexed column and see what happens.

David




Re: Feature-Request: Performance-Optimization when using limit in combination with order by on querys using union

2025-05-08 Thread Tom Lane
Karsten P  writes:
> i'm sorry i didn't check that first. it just won't work in my real-life 
> example.
> though each part of the query is using an index-scan it is than using a 
> 'normal' append
> instead of a merge-append, but i don't know why.

The "Subquery Scan" nodes shown in your real-life example indicate
that you're using views that the planner is unable to flatten
completely, and those are preventing detection that the index you want
to use would be helpful.  The view you showed originally wouldn't be
that, so there is something you're doing that you left out.  It looks
like your actual view contains some WHERE restrictions in the UNION
arms, which I think are enough to cause this problem.  Even then,
though, the "Subquery Scan" nodes get optimized away in simple tests,
which means there's an additional optimization blocker.  I'd look
closely at whether the output column types of the UNION arms match.

regards, tom lane




Re: pg_rewind problem: cannot find WAL

2025-05-08 Thread Luca Ferrari
On Thu, May 8, 2025 at 4:04 PM Rob Sargent  wrote:
>
>
> A symlink from $PGDATA to where actual file?
>

Could be, I need to experiment with pg_basebackup to ensure it is not
conflicting with the /etc/ configuration file when creating a clone.

Luca




Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669

2025-05-08 Thread Adrian Klaver

On 5/8/25 05:17, איתי זרחוביץ wrote:

,Hello
I have a MacBook with an M4 chip. I tried installing PostgreSQL version 
17.5, but after the

installation, I received the following error
|
_LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
.and the application fails to launch

A screenshot of the error is attached for reference


Per the comment on your SO question pertaining to this, you need to 
provide more details:


1) Where did you get the package you are installing?

2) What was the command you used to do the install?


|

.I also tried installing older versions, but encountered the same error
I contacted Apple Support, and they confirmed that my device is working 
properly


Your software is very important for my studies, and I would greatly 
appreciate your help in resolving this issue


Thanks,

Etay



--
Adrian Klaver
adrian.kla...@aklaver.com





Re: EDB Download for PostgreSQL 17.5 is broken

2025-05-08 Thread Kashif Zeeshan
Hi Ertan

Correct Version 17.5.0 is being downloaded and it may be a cache issue.

Regards
Kashif Zeeshan
EDB

On Thu, May 8, 2025 at 9:29 PM Ertan Küçükoglu 
wrote:

> Hello,
>
> I am just writing here with the hope that there are some EDB contacts here.
>
> The 17.5 version Windows x86-64 download link on EDB is
> https://sbp.enterprisedb.com/getfile.jsp?fileid=1259563 and this is
> actually getting you a 17.4-2 download.
>
> Thanks & Regards,
> Ertan
>


Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-08 Thread Philipp Defner
Go to https://postgresapp.com/downloads.html, download the app, install and 
connect to the running instance with your Postgres GUI client of choice. If 
it's an important part of your studies you should be able to figure out to get 
it running too.

The error message you originally shared isn't a Postgres issue but a macOS 
issue.

On Fri, May 9, 2025, at 1:57 PM, איתי זרחוביץ wrote:
> Ok
> So, in order to install it well, what are the steps that i need to take from 
> the beginning?
> I already have the application on my Mac but it doesn’t want 
> 
> On Fri, 9 May 2025 at 8:43 Philipp Defner  wrote:
>> __
>> Hey, please use "Reply All" when you reply (As someone else already told you 
>> before I saw), as otherwise the response only goes to me directly and nobody 
>> else can follow along or help you.
>> 
>> After a quick online search it seems that this error means you don't have 
>> Rosetta installed, this is the emulation layer that Apple provides to run 
>> Apps built for Intel on Apple Silicon Mac.
>> 
>> If you run this in your Terminal, it might not say "rosetta installed": "if 
>> /usr/bin/pgrep -q oahd; then echo 'rosetta installed'; fi"
>> 
>> I'd try Postgres.app from the download page I mentioned, or install Rosetta: 
>> "`/usr/sbin/softwareupdate --install-rosetta --agree-to-license"`
>> 
>> On Fri, May 9, 2025, at 1:31 PM, איתי זרחוביץ wrote:
>>> Hey,
>>> I tried to install PostrgreSQL,version 17.5 via 
>>> https://www.postgresql.org/download/macosx/.
>>> When the download was complete, the application opened. I clicked 'next' to 
>>> process and finish the installation, and finally, when I tried to open the 
>>> application,
>>> it showed me this error:
>>> _LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
>>> I also tried to install version 16.9 and I got the same error
>>> 
>>> ‫בתאריך יום ו׳, 9 במאי 2025 ב-8:12 מאת ‪Philipp Defner‬‏ 
>>> <‪m...@notmyhostna.me‬‏>:‬
 __
 Hey, you'll need to give a bit more information here. How did you install 
 Postgres and what are you doing to see this error message?
 
 There's multiple ways recommended on 
 https://www.postgresql.org/download/macosx/, personally I'd give 
 Postgres.app a. try or the installation via Homebrew (A bit less easy than 
 the GUI app)
 
 Philipp
 
 On Thu, May 8, 2025, at 8:17 PM, איתי זרחוביץ wrote:
> ,Hello
> I have a MacBook with an M4 chip. I tried installing PostgreSQL version 
> 17.5, but after the 
> installation, I received the following error
> _LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
> .and the application fails to launch
> 
> A screenshot of the error is attached for reference 
> 
> 
> 
> 
> .I also tried installing older versions, but encountered the same error
> I contacted Apple Support, and they confirmed that my device is working 
> properly
> 
> 
> Your software is very important for my studies, and I would greatly 
> appreciate your help in resolving this issue
> 
> Thanks,
> 
> Etay
> 
> 
> *Attachments:*
>  • WhatsApp Image 2025-05-07 at 08.23.48.jpeg
 
>> 


Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669

2025-05-08 Thread Adrian Klaver

On 5/8/25 12:02, איתי זרחוביץ wrote:

Reply to list also:
Ccing list.


I tried to download from this link:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads 

and than i got the error  _LSOpenURLsWithCompletionHandler() failed with 
error -10669 (1)


1) This is not a launch/install issue it is a download issue.

2) I could reach the link and download the dmg file on my Linux machine.

3) When did you last try the download?

4) Try the postgres.app site https://postgresapp.com/ and see if that works.



On Thu, 8 May 2025 at 21:50 Adrian Klaver > wrote:


On 5/8/25 05:17, איתי זרחוביץ wrote:
 > ,Hello
 > I have a MacBook with an M4 chip. I tried installing PostgreSQL
version
 > 17.5, but after the
 > installation, I received the following error
 > |
 > _LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
 > .and the application fails to launch
 >
 > A screenshot of the error is attached for reference

Per the comment on your SO question pertaining to this, you need to
provide more details:

1) Where did you get the package you are installing?

2) What was the command you used to do the install?

 > |
 >
 > .I also tried installing older versions, but encountered the same
error
 > I contacted Apple Support, and they confirmed that my device is
working
 > properly
 >
 > Your software is very important for my studies, and I would greatly
 > appreciate your help in resolving this issue
 >
 > Thanks,
 >
 > Etay
 >

-- 
Adrian Klaver

adrian.kla...@aklaver.com 



--
Adrian Klaver
adrian.kla...@aklaver.com





Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669

2025-05-08 Thread Adrian Klaver

On 5/8/25 12:41, איתי זרחוביץ wrote:

You need to remember to hit Reply All so the list is included in the 
conversation.


Ccing list


I tried before a hour to download


Try now and see what happens.

Also try the postgres.app link I posted previously.




--
Adrian Klaver
adrian.kla...@aklaver.com





Looking for pgbench Benchmark Results Across PostgreSQL Versions

2025-05-08 Thread Özkan Pakdil
Hi everyone,

I’ve been searching for a website that provides pgbench results for
different PostgreSQL versions, from 11 to 18, including the latest beta or
alpha releases.

Does anyone know of such a site?

Thanks!


Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-08 Thread Philipp Defner
Hey, you'll need to give a bit more information here. How did you install 
Postgres and what are you doing to see this error message?

There's multiple ways recommended on 
https://www.postgresql.org/download/macosx/, personally I'd give Postgres.app 
a. try or the installation via Homebrew (A bit less easy than the GUI app)

Philipp

On Thu, May 8, 2025, at 8:17 PM, איתי זרחוביץ wrote:
> ,Hello
> I have a MacBook with an M4 chip. I tried installing PostgreSQL version 17.5, 
> but after the 
> installation, I received the following error
> _LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
> .and the application fails to launch
> 
> A screenshot of the error is attached for reference 
> 
> 
> 
> 
> .I also tried installing older versions, but encountered the same error
> I contacted Apple Support, and they confirmed that my device is working 
> properly
> 
> 
> Your software is very important for my studies, and I would greatly 
> appreciate your help in resolving this issue
> 
> Thanks,
> 
> Etay
> 
> 
> *Attachments:*
>  • WhatsApp Image 2025-05-07 at 08.23.48.jpeg


Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-08 Thread Philipp Defner
Hey, please use "Reply All" when you reply (As someone else already told you 
before I saw), as otherwise the response only goes to me directly and nobody 
else can follow along or help you.

After a quick online search it seems that this error means you don't have 
Rosetta installed, this is the emulation layer that Apple provides to run Apps 
built for Intel on Apple Silicon Mac.

If you run this in your Terminal, it might not say "rosetta installed": "if 
/usr/bin/pgrep -q oahd; then echo 'rosetta installed'; fi"

I'd try Postgres.app from the download page I mentioned, or install Rosetta: 
"`/usr/sbin/softwareupdate --install-rosetta --agree-to-license"`

On Fri, May 9, 2025, at 1:31 PM, איתי זרחוביץ wrote:
> Hey,
> I tried to install PostrgreSQL,version 17.5 via 
> https://www.postgresql.org/download/macosx/.
> When the download was complete, the application opened. I clicked 'next' to 
> process and finish the installation, and finally, when I tried to open the 
> application,
> it showed me this error:
> _LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
> I also tried to install version 16.9 and I got the same error
> 
> ‫בתאריך יום ו׳, 9 במאי 2025 ב-8:12 מאת ‪Philipp Defner‬‏ 
> <‪m...@notmyhostna.me‬‏>:‬
>> __
>> Hey, you'll need to give a bit more information here. How did you install 
>> Postgres and what are you doing to see this error message?
>> 
>> There's multiple ways recommended on 
>> https://www.postgresql.org/download/macosx/, personally I'd give 
>> Postgres.app a. try or the installation via Homebrew (A bit less easy than 
>> the GUI app)
>> 
>> Philipp
>> 
>> On Thu, May 8, 2025, at 8:17 PM, איתי זרחוביץ wrote:
>>> ,Hello
>>> I have a MacBook with an M4 chip. I tried installing PostgreSQL version 
>>> 17.5, but after the 
>>> installation, I received the following error
>>> _LSOpenURLsWithCompletionHandler() failed with error -10669 (1)
>>> .and the application fails to launch
>>> 
>>> A screenshot of the error is attached for reference 
>>> 
>>> 
>>> 
>>> 
>>> .I also tried installing older versions, but encountered the same error
>>> I contacted Apple Support, and they confirmed that my device is working 
>>> properly
>>> 
>>> 
>>> Your software is very important for my studies, and I would greatly 
>>> appreciate your help in resolving this issue
>>> 
>>> Thanks,
>>> 
>>> Etay
>>> 
>>> 
>>> *Attachments:*
>>>  • WhatsApp Image 2025-05-07 at 08.23.48.jpeg
>>