Hi,

I think this is probably the same problem that Matteo ran into, but when using 
emulate mode, pgsql errors out with code like this:

```
<?php
$db = new PDO(
    pgsql:/* dsn */,
    /* username */,
    /* password */,
    [
        PDO::ATTR_EMULATE_PREPARES => true,
    ],
);

$db->exec('CREATE TABLE test2 (val BOOLEAN)');

$stmt = $db->prepare('INSERT INTO test2 VALUES(:val)');
$stmt->bindValue(':val', 1, PDO::PARAM_INT);
$stmt->execute();
```

```
Fatal error: Uncaught PDOException: SQLSTATE[42804]: Datatype mismatch: 7 
ERROR:  column "val" is of type boolean but expression is of type integer
```

It seems a little strange that whether an error occurs or not depends on 
whether you are in emulation mode or not.

Saki
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to