Bug: Database session handler using postgres
PHP Version
7.4
CodeIgniter4 Version
4.1.7
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
PostgreSQL14
What happened?
If the session handle is database, it throwing an error.
Steps to Reproduce
Install CI4 and use PostreSQL as the database Set the session handler to database
Expected Output
The system will use database sessions without breaking. I have to change change Vendor > Codeigniter4 >- framework > Session > Handlers > DatabaseHandler.php line line 122 to
->select($this->platform === 'postgre' ? "encode(data, 'base64') AS data" : 'data')
to
change Vendor > Codeigniter4 >- framework > Session > Handlers > DatabaseHandler.php line line 122 to
->select($this->platform === 'postgre' ? "encode(data::bytea, 'base64') AS data" : 'data')
Anything else?
I have given my solution as above.
@githaigamaina Thank you for reporting! Why don't you send a PR? See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/README.md
Can't reproduce on develop and postgres:13-alpine, PHP 8.0.15.
Can't reproduce onpostgres:14-alpine.
It seems there is no activity for this, and not reproducible. Closing.