php / php/php-src

PGSQL pipeline mode constant PGRES_PIPELINE_ABORTED not found and naming problem

Open
#12,685 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: pgsql Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Hello!

The following code:


<?php
$is_aborted_pipeline_status = (pg_pipeline_status($connection) === PGSQL_PIPELINE_ABORTED); // PQ_PIPELINE_ABORTED
$is_aborted_result_status   = (pg_result_status($result)       === 11);                     // PGRES_PIPELINE_ABORTED

In libpq exists two constant:

PQ_PIPELINE_ABORTED = 2
PGRES_PIPELINE_ABORTED = 11

In php naming constant rules:

PQ_*    -> PGSQL_*
PQRES_* -> PGSQL_*

Need add constant PGRES_PIPELINE_ABORTED in PHP!

The absence of a second constant in IDE autocompletion leads to unobvious errors.

PHP Version

PHP 8.3

Operating System

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching php-src for PGSQL_PIPELINE_ABORTED and the existing pgsql pipeline constants, then inspect the implementation of pg_pipeline_status() and pg_result_status(). Confirm that the missing PGRES_PIPELINE_ABORTED constant maps to libpq's PGRES_PIPELINE_ABORTED value of 11 and add coverage for its availability and value.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php, postgres
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.