Skip to content

Conversation

henderkes
Copy link
Collaborator

What does this PR do?

closes #757

@henderkes henderkes requested a review from crazywhalecc October 6, 2025 21:31
@henderkes henderkes added the kind/dependency Issues related to dependencies label Oct 6, 2025
@henderkes henderkes changed the title update pgsql version to 18.0 update pgsql version to 18.0, php 8.5 to RC1 Oct 7, 2025
@henderkes henderkes changed the title update pgsql version to 18.0, php 8.5 to RC1 update pgsql version to 18.0, php 8.5 to RC2 Oct 10, 2025
Copy link
Owner

@crazywhalecc crazywhalecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but it needs connection and runtime test. Will do later.

@henderkes
Copy link
Collaborator Author

Looks good to me, but it needs connection and runtime test. Will do later.

Works for me.

<?php
$host = "localhost";
$db   = "appdb";
$user = "appuser";
$pass = "strongpassword";

$dsn = "pgsql:host=$host;dbname=$db";

try {
    $pdo = new PDO($dsn, $user, $pass, [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
    ]);
} catch (PDOException $e) {
    die("Connection failed: " . $e->getMessage());
}

// Create table if not exists
$pdo->exec("
    CREATE TABLE IF NOT EXISTS test_data (
        id SERIAL PRIMARY KEY,
        value TEXT NOT NULL
    );
");

// Insert random data
$randomValue = bin2hex(random_bytes(8));
$stmt = $pdo->prepare("INSERT INTO test_data (value) VALUES (:val)");
$stmt->execute([':val' => $randomValue]);

// Select and print all rows
$stmt = $pdo->query("SELECT id, value FROM test_data ORDER BY id ASC");
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);

header('Content-Type: text/plain');
foreach ($rows as $row) {
    echo $row['id'] . " | " . $row['value'] . "\n";
}
?>
[m@M static-php-cli]$ buildroot/bin/php ../pgsql.php
1 | bbd58a0ed06e6857
2 | d13bef167723c0d3

@crazywhalecc
Copy link
Owner

I refactored a few things for pgsql. Now it's compatible with internal SPCConfigUtil with no pain.

For specific line patching, I found it could be disabled by just removing them, make it version-independent now.

@henderkes henderkes merged commit d0a6e3a into main Oct 12, 2025
11 checks passed
@henderkes henderkes deleted the pgsql-18 branch October 12, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/dependency Issues related to dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update to postgresql 18

2 participants