Skip to content

Remove redundant DROP FUNCTIONs #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2023
Merged

Remove redundant DROP FUNCTIONs #300

merged 1 commit into from
Jan 21, 2023

Conversation

robins
Copy link
Contributor

@robins robins commented Jan 21, 2023

Upgrading extension from v1.1.0 to v1.2.0 fails.

The error is owing to multiple DROP FUNCTION calls with similar signature. The script would have succeeded if they were DROP FUNCTION IF EXISTS, but that seems unnecessary here.

postgres=# create extension pgtap version '1.1.0';
CREATE EXTENSION
postgres=# \dx
                 List of installed extensions
  Name   | Version |   Schema   |         Description
---------+---------+------------+------------------------------
 pgtap   | 1.1.0   | public     | Unit testing for PostgreSQL
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

postgres=# select * from pg_available_extension_versions where name = 'pgtap';
 name  | version | installed | superuser | trusted | relocatable | schema | requires  |           comment
-------+---------+-----------+-----------+---------+-------------+--------+-----------+-----------------------------
 pgtap | 1.1.0   | t         | f         | f       | t           |        | {plpgsql} | Unit testing for PostgreSQL
 pgtap | 1.2.0   | f         | f         | f       | t           |        | {plpgsql} | Unit testing for PostgreSQL
 pgtap | 1.2.1   | f         | f         | f       | t           |        | {plpgsql} | Unit testing for PostgreSQL
(3 rows)

postgres=# alter extension pgtap update to '1.2.0';
ERROR:  function _agg(name) does not exist

@theory theory self-assigned this Jan 21, 2023
Copy link
Owner

@theory theory left a comment

Choose a reason for hiding this comment

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

🤦🏻 Nice find, thank you!

@theory theory merged commit e1436a1 into theory:master Jan 21, 2023
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.

2 participants