Posting this here so that other people who have that problem can find the solution because it really wasn't easy to find that the problem was with csh rather than sh, bash, or the system/kernel parameters.
I have the following error:
$ isql
SQL> CONNECT /Users/paul/STTDB3. FDB5;
Statement failed, SQLSTATE = 08001
I/0 error during "open" operation for file "/tmp/firebird/fb_tpc_0d000001ba2560600000000_8736"'
-Error while trying to open file
-Too many open files
And in JetBrains PyCharm and DataGrip I have this error:
DBMS: Firebird (no ver.)
Case sensitivity: plain=mixed, delimited=exact
[08001][335544344] I/O error during "open" operation for file "/tmp/firebird/fb_tpc_0f000001bae2560600000000_8729"; Error while trying to open file; Too many open files [SQLState:08001, ISC error code:335544344].
Solution ✅
How to fix the Firebird server service:
echo 'limit openfiles 65535' | sudo tee -a /etc/csh.login
How to fix isql:
echo 'ulimit -n 65535' | sudo tee -a /etc/profile
echo 'ulimit -n 65535' | sudo tee -a /etc/zprofile
This should be enough. But if it still doesn't work you can attempt to run these in addition:
sudo launchctl limit maxfiles 65535 unlimited
sudo sysctl -w kern.maxfiles=245760
sudo sysctl -w kern.maxfilesperproc=122880
If these 3 last commands fixed it you will need to run them at boot to persist them. You can create two launch daemon files for that:
/Library/LaunchDaemons/limit.maxfiles.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>65535</string>
<string>unlimited</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
and
/Library/LaunchDaemons/kern.maxfiles.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>kern.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/sysctl</string>
<string>-w</string>
<string>kern.maxfiles=245760</string>
<string>kern.maxfilesperproc=122880</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
My configuration:
- Firebird 5.0.1 on macOS (Mac M2 / arm64 / Apple Silicon)
- Installation package:
Firebird-5.0.1.1469-0-macos-arm64.pkg
OS: macOS Sonoma 14.7.1 (23H222) arm64
Host: MacBook Pro (16-inch, 2023)
Kernel: Darwin 23.6.0

Posting this here so that other people who have that problem can find the solution because it really wasn't easy to find that the problem was with
cshrather than sh, bash, or the system/kernel parameters.I have the following error:
And in JetBrains PyCharm and DataGrip I have this error:
Solution ✅
How to fix the Firebird server service:
How to fix
isql:This should be enough. But if it still doesn't work you can attempt to run these in addition:
If these 3 last commands fixed it you will need to run them at boot to persist them. You can create two launch daemon files for that:
/Library/LaunchDaemons/limit.maxfiles.plist:and
/Library/LaunchDaemons/kern.maxfiles.plist:My configuration:
Firebird-5.0.1.1469-0-macos-arm64.pkg