Welcome Guest, Not a member yet? Register   Sign In
Type casting in PostgreSQL with updateBatch()
#17

The quick and easy fix for this is to use RawSql as well as casting your php values:
Code:
$data = [
                [
                    'name'                  => 'Derek Jones',
                    'savings'               => (float) '28389.48',
                    'updated_at' => new RawSql("'2023-12-02 18:47:52'::TIMESTAMP"),
                ],
            ];

https://codeigniter.com/user_guide/datab...tml#rawsql

Another things to have a look at is:

https://www.postgresql.org/docs/current/...ecast.html
Reply


Messages In This Thread
RE: Type casting in PostgreSQL with updateBatch() - by sclubricants - 01-19-2024, 03:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB