嗨,我已经用自制软件安装了PostgreSQL 12,并且我在这个提交https://github.com/pgpartman/pg_partman/commit/63328c5bd1f8009fc95592fcdd8ff45f148829e6上克隆了pg_partman。
在克隆的文件夹中,我运行了make install
,但它显示:
(pg_partman) git:(master) $ make install
cat sql/types/types.sql sql/tables/tables.sql sql/functions/apply_cluster.sql sql/functions/apply_constraints.sql sql/functions/apply_foreign_keys.sql sql/functions/apply_privileges.sql sql/functions/apply_publications.sql sql/functions/autovacuum_off.sql sql/functions/autovacuum_reset.sql sql/functions/check_control_type.sql sql/functions/check_default.sql sql/functions/check_name_length.sql sql/functions/check_subpart_sameconfig.sql sql/functions/check_subpartition_limits.sql sql/functions/create_function_id.sql sql/functions/create_function_time.sql sql/functions/create_parent.sql sql/functions/create_partition_id.sql sql/functions/create_partition_time.sql sql/functions/create_sub_parent.sql sql/functions/create_trigger.sql sql/functions/drop_constraints.sql sql/functions/drop_partition_column.sql sql/functions/drop_partition_id.sql sql/functions/drop_partition_time.sql sql/functions/dump_partition_table_definition.sql sql/functions/inherit_template_properties.sql sql/functions/partition_data_id.sql sql/functions/partition_data_time.sql sql/functions/partition_gap_fill.sql sql/functions/reapply_privileges.sql sql/functions/run_maintenance.sql sql/functions/show_partition_info.sql sql/functions/show_partition_name.sql sql/functions/show_partitions.sql sql/functions/stop_sub_partition.sql sql/functions/undo_partition.sql sql/procedures/partition_data_proc.sql sql/procedures/reapply_constraints_proc.sql sql/procedures/run_maintenance_proc.sql sql/procedures/undo_partition_proc.sql > sql/pg_partman--4.4.1.sql
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I./ -I/usr/local/opt/postgresql@12/include/server -I/usr/local/opt/postgresql@12/include/internal -I/usr/local/Cellar/icu4c/67.1/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -c -o src/pg_partman_bgw.o src/pg_partman_bgw.c
src/pg_partman_bgw.c:10:10: fatal error: 'postgres.h' file not found
#include "postgres.h"
^~~~~~~~~~~~
1 error generated.
make: *** [src/pg_partman_bgw.o] Error 1
快速调查建议安装postgresql-server-dev-12,但我找不到任何与macOS相关的东西。
知道我错过了什么吗?提前感谢!
发布于 2021-07-27 20:54:51
当我问这个问题时,我想我安装了一个坏的PostgreSQL (这就是为什么没有标题)。所以如果你遇到了同样的错误,你可以尝试reinstall your PostgreSQL。
pg_partman的安装与their README described的安装完全相同。克隆存储库,更改PostgreSQL配置,重新启动PostgreSQL,然后运行CREATE EXTENSION
。
$ git clone https://github.com/pgpartman/pg_partman.git
$ cd pg_partman
$ make install
$ vim /usr/local/var/postgres/postgresql.conf
shared_preload_libraries = 'pg_partman_bgw' # (change requires restart)
$ brew services restart postgresql
$ psql yourdb
=# CREATE EXTENSION pg_partman;
然后,您可以使用\dx
查看是否正确安装了它:
List of installed extensions
Name | Version | Schema | Description
--------------------+---------+------------+------------------------------------------------------------------------
pg_partman | 4.5.1 | public | Extension to manage partitioned tables by time or ID
发布于 2021-11-30 04:18:17
或者使用来自https://github.com/sj26/homebrew-postgresql-extensions/的自定义自制配方
$ brew install sj26/postgresql-extensions/pg_partman
然后按照说明编辑postgresql conf。
https://stackoverflow.com/questions/66475018
复制相似问题