Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Build fails on FreeBSD: error: redefinition of 'addrinfo'

Open
#401 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, postgresql
Domain
databases

Research direction

Start with extension/postgres_scanner/postgres/src/include/getaddrinfo.h and pqcomm.h, then compare their definitions with FreeBSD's /usr/include/netdb.h and sys/_sockaddr_storage.h. Reproduce the build on FreeBSD and update the platform handling so the bundled sources no longer redefine these structures; done means the build completes without both errors.

Written by the indexing model from the issue text.

Description

What happens?
In file included from /usr/ports/databases/duckdb/work/duckdb-1.4.4/extension/postgres_scanner/postgres/src/common/ip.c:37:
In file included from /usr/ports/databases/duckdb/work/duckdb-1.4.4/extension/postgres_scanner/postgres/src/include/common/ip.h:17:
/usr/ports/databases/duckdb/work/duckdb-1.4.4/extension/postgres_scanner/postgres/src/include/getaddrinfo.h:98:8: error: redefinition of 'addrinfo'
   98 | struct addrinfo
      |        ^
/usr/include/netdb.h:133:8: note: previous definition is here
  133 | struct addrinfo {
      |        ^
In file included from /usr/ports/databases/duckdb/work/duckdb-1.4.4/extension/postgres_scanner/postgres/src/common/ip.c:37:
In file included from /usr/ports/databases/duckdb/work/duckdb-1.4.4/extension/postgres_scanner/postgres/src/include/common/ip.h:18:
/usr/ports/databases/duckdb/work/duckdb-1.4.4/extension/postgres_scanner/postgres/src/include/libpq/pqcomm.h:44:8: error: redefinition of 'sockaddr_storage'
   44 | struct sockaddr_storage
      |        ^
/usr/include/sys/_sockaddr_storage.h:45:8: note: previous definition is here
   45 | struct sockaddr_storage {
      |        ^
2 errors generated.

These structures are re-defined in the downloaded code tarball and structures are different.

To Reproduce

Build on FreeBSD.

OS:

FreeBSD 15 STABLE

PostgreSQL Version:

N/A

DuckDB Version:

1.4.4

DuckDB Client:

1.4.4

Full Name:

Yuri Vic

Affiliation:

FreeBSD

Have you tried this on the latest main branch?
  • I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
  • I agree
Dominant language
C++
Stars
375
Forks
113
Avg merge
6h 42m
Merged PRs (30d)
30

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from duckdb/duckdb-postgres

All issues in duckdb/duckdb-postgres

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.