Skip to content
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

Could not load library on postgresql 12 #43

Closed
konstantin-kostadinov opened this issue Oct 9, 2019 · 3 comments
Closed

Could not load library on postgresql 12 #43

konstantin-kostadinov opened this issue Oct 9, 2019 · 3 comments
Assignees

Comments

@konstantin-kostadinov
Copy link

After pg_upgrade from v11 to v12 I'm getting this error when craeting the extension.
ERROR: could not load library "/usr/lib/postgresql/12/lib/hypopg.so": /usr/lib/postgresql/12/lib/hypopg.so: undefined symbol: AllocSetContextCreateExtended

@rjuju rjuju self-assigned this Oct 9, 2019
@rjuju
Copy link
Member

rjuju commented Oct 9, 2019

Hello,

hypopg is calling AllocSetContextCreate(): https://github.com/HypoPG/hypopg/blob/REL1_STABLE/hypopg.c#L94

This is a macro calling AllocSetContextCreateExtended in pg11:

#if defined(HAVE__BUILTIN_CONSTANT_P) && defined(HAVE__VA_ARGS)
#define AllocSetContextCreate(parent, name, ...) \
	(StaticAssertExpr(__builtin_constant_p(name), \
					  "memory context names must be constant strings"), \
	 AllocSetContextCreateExtended(parent, name, __VA_ARGS__))
#else
#define AllocSetContextCreate \
	AllocSetContextCreateExtended
#endif

but not anymore in pg12:

#ifdef HAVE__BUILTIN_CONSTANT_P
#define AllocSetContextCreate(parent, name, ...) \
	(StaticAssertExpr(__builtin_constant_p(name), \
					  "memory context names must be constant strings"), \
	 AllocSetContextCreateInternal(parent, name, __VA_ARGS__))
#else
#define AllocSetContextCreate \
	AllocSetContextCreateInternal
#endif

This was changed in postgres/postgres@13cd7209f79.

It seems that this version you're using was compiled against pg11, or an older version of pg12. How did you install it?

@konstantin-kostadinov
Copy link
Author

I upgraded using pg_upgradecluster.
You are right. After recompiling hypopg the error disappeared.
Thank you!

@rjuju
Copy link
Member

rjuju commented Oct 9, 2019

Good news!

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

No branches or pull requests

2 participants