xref: /PHP-8.1/ext/pgsql/tests/80_bug39971.phpt (revision 1f427779)
1--TEST--
2Bug #39971 (8.0+) (pg_insert/pg_update do not allow now() to be used for timestamp fields)
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php
7require_once('skipif.inc');
8?>
9--FILE--
10<?php
11
12require_once('config.inc');
13
14$dbh = @pg_connect($conn_str);
15if (!$dbh) {
16    die ("Could not connect to the server");
17}
18
19pg_query($dbh, "CREATE TABLE php_test (id SERIAL, tm timestamp NOT NULL)");
20
21$values = array('tm' => 'now()');
22pg_insert($dbh, 'php_test', $values);
23
24$ids = array('id' => 1);
25pg_update($dbh, 'php_test', $values, $ids);
26
27pg_query($dbh, "DROP TABLE php_test");
28pg_close($dbh);
29?>
30===DONE===
31--EXPECT--
32===DONE===
33