Skip to content

Bug - pg dump throws error "cannot duplicate null pointer" if the database to be dumped contain packages #857

@yasir-hussain-shah

Description

@yasir-hussain-shah

Bug Report

IvorySQL Version

IvorySQL 4.5 STABLE

OS Version (uname -a)

Ubuntu 24.04.2 LTS

Configuration options ( config.status --config )

--enable-tap-tests --with-oraport=1521

Current Behavior

pg_dump throws "cannot duplicate null pointer" error if a db to be dumped contains packages.

Expected behavior/code

pg_dump should not throw any error and successfully dump the database along with packages.

Step to reproduce

  1. Create a fresh data directory and start the server:
initdb test_data_dir

pg_ctl -D test_data_dir  -l logfile start
  1. Create a fresh database and create a simple package in it:
psql -h localhost -U ivorysql -d ivorysql -p 1521 -c "create database testdb;"

psql -h localhost -U ivorysql -d testdb -p 1521 -c "CREATE OR REPLACE PACKAGE test_pkg AS
  FUNCTION hello() RETURN text;
END test_pkg;
CREATE OR REPLACE PACKAGE BODY test_pkg AS
  FUNCTION hello() RETURN text IS
  BEGIN                          
    RETURN 'Hello from test package';
  END;                               
END test_pkg;"
  1. Take the dump:
pg_dump -h localhost -p 1521 -U ivorysql testdb
or
pg_dump -h localhost -U ivorysql testdb
  1. Notice that following error occurs:
pg_dump -h localhost -p 1521 -U ivorysql testdb
cannot duplicate null pointer (internal error)

Additional Info

The bug is already fixed and a PR has been created for that at link: #856

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions