Keywords
9 months ago
MySQL
2 years ago
AbstractMySQLPlatform.php
9 months ago
AbstractPlatform.php
9 months ago
DateIntervalUnit.php
2 years ago
MariaDBPlatform.php
2 years ago
MariaDb1010Platform.php
9 months ago
MariaDb1027Platform.php
2 years ago
MariaDb1043Platform.php
2 years ago
MariaDb1052Platform.php
2 years ago
MariaDb1060Platform.php
2 years ago
MariaDb110700Platform.php
9 months ago
MySQL57Platform.php
2 years ago
MySQL80Platform.php
2 years ago
MySQL84Platform.php
9 months ago
MySQLPlatform.php
2 years ago
PostgreSQL120Platform.php
9 months ago
TrimMode.php
2 years ago
index.php
2 years ago
PostgreSQL120Platform.php
26 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\DBAL\Platforms; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | class PostgreSQL120Platform extends PostgreSQL100Platform |
| 6 | { |
| 7 | public function getDefaultColumnValueSQLSnippet() : string |
| 8 | { |
| 9 | // in case of GENERATED ALWAYS AS (foobar) STORED column (added in PostgreSQL 12.0) |
| 10 | // PostgreSQL's pg_get_expr(adbin, adrelid) will return the 'foobar' part |
| 11 | // which is not the 'default' value of the column but its 'definition' |
| 12 | // so in that case we force it to NULL as DBAL will use that column only for the |
| 13 | // 'default' value |
| 14 | return <<<'SQL' |
| 15 | SELECT |
| 16 | CASE |
| 17 | WHEN a.attgenerated = 's' THEN NULL |
| 18 | ELSE pg_get_expr(adbin, adrelid) |
| 19 | END |
| 20 | FROM pg_attrdef |
| 21 | WHERE c.oid = pg_attrdef.adrelid |
| 22 | AND pg_attrdef.adnum=a.attnum |
| 23 | SQL; |
| 24 | } |
| 25 | } |
| 26 |