Skip to content

Cherry-pick from PG13: Go back to returning int from ereport auxiliary functions. - #1548

Open
reshke wants to merge 1 commit into
apache:mainfrom
reshke:ff
Open

reshke wants to merge 1 commit into
apache:mainfrom
reshke:ff

Conversation

@reshke

@reshke reshke commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

I was casually compiling Cloudberry with some postrgesql extensions and faced a compile issue:

/usr/local/cbdb/include/postgresql/server/utils/elog.h:215:13: error: conflicting declaration of C function ‘void errmsg_internal(const char*, ...)’
  215 | extern void errmsg_internal(const char *fmt,...) pg_attribute_printf(1, 2);
      |             ^~~~~~~~~~~~~~~

This is basically because contents of postgres/postgres@bda6ded is missing in cbdb. So, lets cherry-pick it

original commit msg follows:

====

This reverts the parts of commit 17a28b0 that changed ereport's auxiliary functions from returning dummy integer values to returning void. It turns out that a minority of compilers complain (not entirely unreasonably) about constructs such as

(condition) ? errdetail(...) : 0

if errdetail() returns void rather than int. We could update those call sites to say "(void) 0" perhaps, but the expectation for this patch set was that ereport callers would not have to change anything. And this aspect of the patch set was already the most invasive and least compelling part of it, so let's just drop it.

Per buildfarm.

Discussion: https://postgr.es/m/CA+fd4k6N8EjNvZpM8nme+y+05mz-SM8Z_BgkixzkA34R+ej0Kw@mail.gmail.com

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@reshke
reshke requested a review from my-ship-it January 28, 2026 10:48
@reshke
reshke requested a review from tuhaihe February 4, 2026 13:59
@reshke

reshke commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

(dont trigger for merge commits here, I will correctly rebase branch once review is done)

This reverts the parts of commit 17a28b0
that changed ereport's auxiliary functions from returning dummy integer
values to returning void.  It turns out that a minority of compilers
complain (not entirely unreasonably) about constructs such as

	(condition) ? errdetail(...) : 0

if errdetail() returns void rather than int.  We could update those
call sites to say "(void) 0" perhaps, but the expectation for this
patch set was that ereport callers would not have to change anything.
And this aspect of the patch set was already the most invasive and
least compelling part of it, so let's just drop it.

Per buildfarm.

Discussion: https://postgr.es/m/CA+fd4k6N8EjNvZpM8nme+y+05mz-SM8Z_BgkixzkA34R+ej0Kw@mail.gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants