Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea7ed4d

Browse files
committed
Merge branch 'dump_stat_extension' into PGPRO9_5
Add new contrib module wich allows backup and restore table statisticsalong with data or even move statistics to newer version of serverduring upgrade.
2 parents55d3f1c +515da95 commitea7ed4d

File tree

7 files changed

+823
-0
lines changed

7 files changed

+823
-0
lines changed

‎contrib/dump_stat/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# contrib/pageinspect/Makefile
2+
3+
MODULE_big= dump_stat
4+
OBJS= anyarray_elemtype.o$(WIN32RES)
5+
6+
EXTENSION = dump_stat
7+
DATA = dump_stat--1.0.sql
8+
PGFILEDESC = "dump_stat - move pg_statistic to new instance of PostgreSQL"
9+
10+
ifdefUSE_PGXS
11+
PG_CONFIG = pg_config
12+
PGXS :=$(shell$(PG_CONFIG) --pgxs)
13+
include$(PGXS)
14+
else
15+
subdir = contrib/dump_stat
16+
top_builddir = ../..
17+
include$(top_builddir)/src/Makefile.global
18+
include$(top_srcdir)/contrib/contrib-global.mk
19+
endif

‎contrib/dump_stat/anyarray_elemtype.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include"postgres.h"
2+
#include"utils/array.h"
3+
4+
5+
PG_MODULE_MAGIC;
6+
7+
PG_FUNCTION_INFO_V1(anyarray_elemtype);
8+
9+
10+
Datum
11+
anyarray_elemtype(PG_FUNCTION_ARGS)
12+
{
13+
#if (PG_VERSION_NUM >=90500)
14+
AnyArrayType*v=PG_GETARG_ANY_ARRAY(0);
15+
PG_RETURN_OID(AARR_ELEMTYPE(v));
16+
#else
17+
ArrayType*v=PG_GETARG_ARRAYTYPE_P(0);
18+
PG_RETURN_OID(ARR_ELEMTYPE(v));
19+
#endif
20+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp