Skip to content

error fix for pg_trigger query & spelling typo #7

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dland
Copy link

@dland dland commented Mar 30, 2017

On 9.6 I was unable to run pgcompacttable without the casting tgtype to integer. You can't cast 16 to shortint because Pg doesn't know how to cast from smallint to boolean implicitly.

Also fixed a spelling typo that was bugging me :)

dland added 2 commits March 30, 2017 11:22
This is required to fix an "operator is not unique: smallint &
integer" error message.
@Melkij
Copy link
Collaborator

Melkij commented Sep 12, 2017

Hi
I can not reproduce error...

melkij=> SELECT count(1) FROM pg_catalog.pg_trigger
  WHERE
      tgrelid = 'foo'::regclass AND
      (tgtype & 16)::boolean;
-[ RECORD 1 ]
count | 1

melkij=> select version();
-[ RECORD 1 ]-------------------------------------------------------------------------------------
version | PostgreSQL 9.6.5 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit

@dland
Copy link
Author

dland commented Sep 12, 2017

What was I thinking when I wrote that? It wasn't 9.6... it concerns an earlier version, 9.2 or 9.3.

@Melkij
Copy link
Collaborator

Melkij commented Sep 12, 2017

Not reproduced in freshly installed 9.5, 9.4, 9.3, 9.2 and even unsupported 9.1 =) Maybe some extensions was installed or custom operators defined?

Error "operator is not unique: smallint & integer" means what both operands types and operator is known. pg_operator system view has unique constraint on (oprname, oprleft, oprright, oprnamespace), so not unique operator is possible only with different namespaces and I think problem was in specific database schema.

@dland
Copy link
Author

dland commented Sep 19, 2017

Hmm, ok. I guess we can leave this here then. (Although the spelling typo is worth fixing :)

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