35 Commits

Author SHA1 Message Date
Daniele Varrazzo
021d0b0393 Fixed broken library paths on recent ubuntu packages
Close #179
2018-05-19 17:12:39 +01:00
Daniele Varrazzo
f996fd8fb3 Allow building with PostgreSQL 10rc1
This is what we get:

    $ pg_config --version
    PostgreSQL 10rc1
2017-09-25 02:33:13 +01:00
Daniele Varrazzo
7d752f2b4e Dropped C file now unused 2017-04-10 11:58:41 +01:00
Daniele Varrazzo
2af90dced1 Dropped sql file for non-extension build 2017-03-29 04:39:02 +01:00
Josh Kupershmidt
949c0ad150 Avoid symbol conflict causing segfault when pg_statsinfo is installed.
Control symbol visibility for functions exported in the pg_repack
shared library, to avoid symbol conflicts with other libraries,
particularly those which may be loaded via shared_preload_libraries
and use conflicting function definitions of our common pgut code,
such as pg_statsinfo.

Verified this fix on my Debian x86_64 machine with PostgreSQL 9.4 and
pg_statsinfo 3.0.2. Would be nice to test this fix on a few other
platforms such as OS X, though I had some difficulty getting
pg_statsinfo to build on OS X. Hopefully closes Issue #43, thanks
to bwtakacy for the report and demonstration of the commited fix in
pg_reorg.
2015-05-31 18:59:05 -04:00
Josh Kupershmidt
080ebd3ed6 Bump up Copyright notices for 2015 2015-01-11 19:01:37 -05:00
Daniele Varrazzo
18f75951e2 Remove generated blank lines from legacy .sql file
They appear cause portability problems.
Fixes issue #12.
2013-11-05 02:24:42 +00:00
Josh Kupershmidt
9c8d519415 Kludge to remove -lpam from LIBS in Makefiles.
Per Issue #7 from armanddp, it seems the RHEL/CentOS packages
of Postgres are built against libpam, which shows up in
the LIBS reported by pg_config. We don't actually need to
link in libpam for pg_repack, so manually remove it from
our LIBS. This helps a little bit for building on
RHEL/CentOS, though the issue of libpgport.a missing
on that platform still looms.
2013-05-23 20:31:56 -04:00
Josh Kupershmidt
95ce24c2a0 More sed tweaks to Makefile for portability.
The -E flag to specify extended regular expressions apparently is
not portable to all platforms, such as CentOS 4.5. Use an uglier
but hopefully more portable basic regular expression in Makefiles.
2013-05-21 21:45:47 -04:00
Daniele Varrazzo
14c4d4653e Make the version number arith without using bc
Not as available as I thought.

Can't use the 0 prefix to make the 3rd number optional as $(()) parses is as
octal, so only use the first 2 numbers.

Also fixed collate test: not available on PG 9.0.
2013-04-18 01:10:22 +01:00
Daniele Varrazzo
c314cbda75 Check PostgreSQL version number as number in the makefile
Not entirely happy about the solution but I like the uniform tests.
2013-04-18 00:29:23 +01:00
Daniele Varrazzo
d13f1b141d Merge branch 'version_check' 2012-11-16 21:32:45 +00:00
Daniele Varrazzo
deaae7dd72 Added version_sql() function and consistency check of sql version 2012-11-16 21:32:28 +00:00
Daniele Varrazzo
e02811689a Fixed non-portable use of sed to parse the version from META
Patch from Josh, with the help of RhodiumToad.
2012-11-16 10:36:16 +00:00
Daniele Varrazzo
0af231dff5 Use a single version number for program, library and SQL
Having the SQL on a different numbering scheme is useful to provide an ungrade
path. But pg_repack has no need of such a path as it can be uninstalled with
no problem, so we are not going to provide update script. Hence it's much
easier to have a single version number for everything.
2012-11-15 23:31:58 +00:00
Daniele Varrazzo
673a8ea100 The repack schema is contained in the pg_repack extension
...not the other way around. This allows DROP EXTENSION ... CASCADE to
remove temporary directories, simplifying the cleanup procedure after an
error, and getting rid of the schema on uninstall.
2012-11-13 14:02:45 +00:00
Daniele Varrazzo
532be6ea25 Provide a single way to install pg_repack
Provide only CREATE EXTENSION support on PG >= 9.1 and only the sql script on
PG < 9.1.

Also dropped the /echo cruft in the extension script: it is broken on pg 9.1
and 9.1.1, and because the script is not installed on versions that don't
support CREATE EXTENSION it is just not terribly useful.
2012-11-12 01:04:46 +00:00
Daniele Varrazzo
ac068cc69b Script to create extension from loose objects dropped altogether
pg_repack doesn't create any object to depend on, so it is always possible drop
it and install a new version instead of upgrading. Creating a robust upgrade
path from loose objects which can be of any version to a target version is
hopelessly brittle, so I'd suggest the user just to drop a previous pg_repack
version and install the new one.
2012-11-12 00:20:41 +00:00
Daniele Varrazzo
7b84eeb010 Get the program and library version from the META file 2012-11-11 18:30:27 +00:00
Daniele Varrazzo
71af7f20be Dropped support for building "in tree": always use PGXS 2012-11-11 17:17:41 +00:00
Daniele Varrazzo
1d60a946ff Added The Reorg Development Team copyright 2012-11-11 03:00:00 +00:00
Daniele Varrazzo
db1c554f60 Dropped executable flags 2012-11-11 02:48:46 +00:00
Daniele Varrazzo
b7799c1782 Fork the pg_repack extension 2012-11-10 22:33:57 +00:00
Daniele Varrazzo
0f8c33f72f Don't use a generic 'unpackaged' version
The behaviour of the script is not really predictable if it is run on the
loose objects of pg_reorg >= 1.1.8. So let's be explicit about what version
we expect as starting point.
2012-11-10 22:02:10 +00:00
Daniele Varrazzo
bd06ec0091 Program metadata version moved to 1.2dev0 2012-11-10 19:59:19 +00:00
Daniele Varrazzo
8b8b859ad3 Create both the standalone and extension sql scripts from the same .in 2012-11-10 19:52:28 +00:00
Masahiko Sakamoto
e9d4ef2557 Supports CREATE EXTENSION.
I've changed lib/Makefile to support CREATE EXTENSION.
In order to work with previeous PostgreSQL version (i.e. < 9.1),
this implementation installs both pg_reorg--1.0.sql and pg_reorg.sql.

This patch lacks regression testcases for CREATE EXTENSION, which I will commit soon.
2012-11-10 19:51:30 +00:00
Takahiro Itagaki
960930b645 Fixed database corruption when target tables have dropped columns, and
there are views or functions depending on columns after dropped ones.
The issue was reported by depesz, and original patch by Denish Patel.

Improved documentation how to build binaries from source.

COPYRIGHT updated.
2011-04-29 05:06:48 +00:00
Takahiro Itagaki
232c9bb6c9 Use one of not-null unique keys to identify rows when the target table doesn't
have a primary key. Some of users want to use not-null unique keys rather than
primary keys because postgres doesn't support REINDEX PRIMARY KEY CONCURRENTLY.

- Support 9.1dev.
- Improve Makefile to use PGXS automatically.
2011-01-06 09:35:15 +00:00
Takahiro Itagaki
79757ccb62 version 1.1.2. 2010-06-01 07:35:01 +00:00
Takahiro Itagaki
7084ec6de9 version 1.0.7. 2010-01-28 06:02:28 +00:00
Takahiro Itagaki
6155932b60 Fix data corruption bug reported by robjderr (#1010664).
pg_reorg broke catalog definition if the target table had any dropped columns.
Now pg_reorg removes dropped columns and renumbers valid columns.
You can use pg_reorg to shrink column definitions if you have many dropped
columns. (without pg_reorg, dropped columns are filled with zero forever)
2009-07-02 09:50:58 +00:00
Takahiro Itagaki
9a8f2e9c33 Fix ownership bug.
New toast table, toast index, and toast type should not have
been owned by the executor of pg_reorg, but by the original owner.
2009-05-14 08:19:25 +00:00
Takahiro Itagaki
29469f40f9 Move drop function calls to another transaction which doesn't have execlusive locks. 2009-01-19 04:28:21 +00:00
Takahiro Itagaki
8af8be23ac Initial revision 2008-12-08 04:32:10 +00:00