Comment faire? j'ai vu qu'il y avait pg_migrator mais je ne sais pas comment ça marche.
Comment faire? j'ai vu qu'il y avait pg_migrator mais je ne sais pas comment ça marche.
https://postgresql.developpez.com/do...tion/francais/
pg_dumpall peut suffire
La théorie, c'est quand on sait tout mais que rien ne fonctionne.
La pratique, c'est quand tout fonctionne mais que personne ne sait pourquoi.
Ici, nous avons réuni théorie et pratique : Rien ne fonctionne ... et personne ne sait pourquoi !
Réplication de base avec Postgresql : http://scheu.developpez.com/tutoriel.../log-shipping/
Merci. ça peut m'aider, mais en fait mon problème c'est surtout que je veux utiliser Slony pour faire une synchro, mais quand je l'install il utilise pg_config qui renvoi que le bin dir est : BINDIR = /usr/lib/postgresql/8.3/bin
alors que en fait c'est 8.2 (il n 'y a meme pas de répertoire 8.3), donc je me suis dit que pour symplifier j'allais installer une autre version, mais l;e plus simple pour moi serait de changer le BINDIR.
Donc en fait ma question est plus simple, comment changer le BINDIR ?
Bonjour.
Pourrais-tu afficher la liste des fichiers présents dans ton /etc/slony? (ainsi que leur contenu; je pense que c'est là dedans que tu peux changer ta variable)
Copier c'est copier; voler c'est vendre un CD une vingtaine d'euros!
Code C : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #include <stdio.h> int main(int argc, char **argv) { printf("So long, and thanks for the fish, Dennis...\n"); return 0; }
Bah justement slony j'ai pas encore pu l'installer à cause de ça, je l'ai juste décompressé, mais pour l'installer j'ai besoin du pg_config : http://www.slony.fr/documentation/installation.html
Dans mon fichier slony :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 /slony1-2.0.2# ls -l total 604 -rwxrwxrwx 1 noc noc 362 2009-07-06 11:37 aclocal.m4 drwxrwxrwx 2 noc noc 4096 2009-07-06 11:37 config -rwxrwxrwx 1 noc noc 2643 2009-07-06 11:37 config.h.in -rw-r--r-- 1 root root 41194 2009-07-07 10:45 config.log -rwxrwxrwx 1 noc noc 350871 2009-07-06 11:37 configure -rwxrwxrwx 1 noc noc 7109 2009-07-06 11:37 configure.ac -rwxrwxrwx 1 noc noc 1099 2009-07-06 11:37 COPYRIGHT drwxrwxrwx 8 noc noc 4096 2009-07-06 11:37 doc -rwxrwxrwx 1 noc noc 2305 2009-07-06 11:37 GNUmakefile.in -rwxrwxrwx 1 noc noc 79612 2009-07-06 11:37 HISTORY-1.1 -rwxrwxrwx 1 noc noc 5160 2009-07-06 11:37 INSTALL -rwxrwxrwx 1 noc noc 735 2009-07-06 11:37 Makefile -rwxrwxrwx 1 noc noc 2518 2009-07-06 11:37 Makefile.global.in drwxrwxrwx 2 noc noc 4096 2009-07-06 11:37 makefiles -rwxrwxrwx 1 noc noc 1913 2009-07-06 11:37 README -rwxrwxrwx 1 noc noc 2486 2009-07-06 11:37 README.Unicode drwxrwxrwx 2 noc noc 4096 2009-07-06 11:37 redhat -rwxrwxrwx 1 noc noc 3281 2009-07-06 11:37 RELEASE -rwxrwxrwx 1 noc noc 8629 2009-07-06 11:37 RELEASE-2.0 -rwxrwxrwx 1 noc noc 11356 2009-07-06 11:37 SAMPLE drwxrwxrwx 2 noc noc 4096 2009-07-06 11:37 share -rwxrwxrwx 1 noc noc 7775 2009-07-06 11:37 slony1.spec.in drwxrwxrwx 11 noc noc 4096 2009-07-06 11:37 src drwxrwxrwx 2 noc noc 4096 2009-07-06 11:37 suse drwxrwxrwx 19 noc noc 4096 2009-07-06 11:37 tests -rwxrwxrwx 1 noc noc 3944 2009-07-06 11:37 TODO drwxrwxrwx 5 noc noc 4096 2009-07-06 11:37 tools -rwxrwxrwx 1 noc noc 3061 2009-07-06 11:37 UPGRADING
et quand je lance le ./configure il y a une erreur car il cherche dans postgresql 8.3 alors que c'est dans le 8.2 :
pourtant après meme si je fais un ./configure --with-pgklibdir=/usr/lib/postgresql/8.2/lib/plpgsql.so (le fichier est bien présent), il me répond :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 pg_config says pg_bindir is /usr/lib/postgresql/8.3/bin/ pg_config says pg_libdir is /usr/lib/ pg_config says pg_includedir is /usr/include/postgresql/ pg_config says pg_pkglibdir is /usr/lib/postgresql/8.3/lib/ pg_config says pg_includeserverdir is /usr/include/postgresql/8.3/server/ checking for correct version of PostgreSQL... 8.3 8.3 Error 1 pg_config says pg_sharedir is /usr/share/postgresql/8.3/ configure: error: /usr/lib/postgresql/8.3/lib//plpgsql.so|sl|dll is not found in the pkglibdir.
configure: error: /usr/lib/postgresql/8.3/lib//plpgsql.so|sl|dll is not found in the pkglibdir.
Please specify the pkglibdir with --with-pgpkglibdir=<dir>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 checking postgres.h usability... yes checking postgres.h presence... yes checking for postgres.h... yes checking for utils/typcache.h... no checking for plpgsql.so... no
Pourrais-tu afficher ce que te retourne un?
Code : Sélectionner tout - Visualiser dans une fenêtre à part ./configure --help
Essaye comme ça:
Code : Sélectionner tout - Visualiser dans une fenêtre à part ./configure --with-pgklibdir=/usr/lib/postgresql/8.2/lib
Copier c'est copier; voler c'est vendre un CD une vingtaine d'euros!
Code C : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #include <stdio.h> int main(int argc, char **argv) { printf("So long, and thanks for the fish, Dennis...\n"); return 0; }
Bonjour, merci de m'avoir répondu :
help me donne ça :
et ./configure --with-pgklibdir=/usr/lib/postgresql/8.2/lib ne fonctionne pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/slony1] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug build with debugging symbols (-g) --disable-rpath do not embed shared library search path in executables --disable-engine Don't build slony1-engine source. (Used when building documentation only) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-pgconfigdir=<dir> Location of the PostgreSQL pg_config program. --with-pgbindir=<dir> Location of the PostgreSQL postmaster. --with-pgincludedir=<dir> Location of the PostgreSQL headers. --with-pgincludeserverdir=<dir> Location of the PostgreSQL server headers. --with-pglibdir=<dir> Location of the PostgreSQL libs. --with-pgpkglibdir=<dir> Location of the PostgreSQL pkglibs. E.g. plpg sql.so --with-pgsharedir=<dir> Location of the PostgreSQL share dir. E.g. po stgresql.conf.sample --with-netsnmp=<dir> Enable snmp support <dir> is the location of net-snmp-config. **EXPERIMENTAL** --with-perltools=<dir> Location to install the perl management tools . Default $PREFIX/bin. --with-perlsharedir=<dir> Location to install slon-tools.pm. Default $p glibdir. --with-docs=<yes|no> Build the sgml documentation default=no --with-docdir=<dir> Location to install all the documentation. De fault is $PREFIX/doc. --with-d2mdir=<dir> Location of docbook2man-spec.pl (Manpages wil l be skipped if not specified) --with-mandir=<dir> Location to install the manpages. Default is $PREFIX/man. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor DOCBOOKSTYLE location of DocBook stylesheets Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations.
Que donne un:?
Code : Sélectionner tout - Visualiser dans une fenêtre à part pg_config --version
Et un?
Code : Sélectionner tout - Visualiser dans une fenêtre à part whereis pg_config
Copier c'est copier; voler c'est vendre un CD une vingtaine d'euros!
Code C : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #include <stdio.h> int main(int argc, char **argv) { printf("So long, and thanks for the fish, Dennis...\n"); return 0; }
Justement c'est ça le problème : alors que j'ai installé la 8.2 et quand je me connecte a pg_adminIII il y a d'ailleur écrit que sur le serveur j'ai la version 8.2.9
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2pg_config --version PostgreSQL 8.3.1
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 whereis pg_config pg_config: /usr/bin/pg_config /usr/share/man/man1/pg_config.1.gz
Comment as-tu installé la 8.2?
Est-ce avec le système de packages de ton système ou l'as tu compilée?
Si tu la compile alors tu dois savoir qu'elle est installée dans /usr/local/pgsql.
ce ui fait que tu dois ajouter /usr/local/pgsql/bin à ton path et /usr/local/pgsql/lib à tes bibliothèques!
Du coup tu pourras faire un lien symbolique 'pg_config' dans /usr/bin vers /usr/local/pgsql/bin/pg_config, et tu pourras relancer ton ./configure
Copier c'est copier; voler c'est vendre un CD une vingtaine d'euros!
Code C : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #include <stdio.h> int main(int argc, char **argv) { printf("So long, and thanks for the fish, Dennis...\n"); return 0; }
D'accord merci je vais essayé, justement ce n'est pas moi qui est installé postgres.
par contre postgres n'est pas dans /usr/local/pgsql/bin
Comme tu le vois je n'ai en fait aucun répertoire pgsql
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 root@k-bd:/usr/bin# whereis pgsql pgsql: root@k-bd:/usr/bin# whereis psql psql: /usr/bin/psql /usr/share/man/man1/psql.1.gz root@k-bd:/usr/bin# whereis postgresql postgresql: /etc/postgresql /usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql
Essaye plutôt:
ls /usr/local | grep p
Ensuite:
Plutôt que:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 whereis postgres
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 whereis postgresql
Copier c'est copier; voler c'est vendre un CD une vingtaine d'euros!
Code C : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #include <stdio.h> int main(int argc, char **argv) { printf("So long, and thanks for the fish, Dennis...\n"); return 0; }
Suggestion: faire
pour voir les packages postgresql installés sur ton système et leurs versions
Code : Sélectionner tout - Visualiser dans une fenêtre à part dpkg -l postgres* libpq*
Et également indiquer comment tu as installé la 8.2: package pré-compilé ou compilation sur place?
pg_config trouve le bindir est prenant son propre chemin et en enlevant son nom à la fin…
voir le code source :
http://doxygen.postgresql.org/pg__config_8c-source.html
son propre chemin est découvert via la fonction find_my_exec()
http://doxygen.postgresql.org/port_8...3c016743026386
et cette fonction résoud les liens symboliques…
si cette fonction renvoit effectivement un chemin qui n'existe pas, vous avez d'autres soucis plus importants à résoudre sur cette machine… !
(et pour répondre à la question : non on ne peut pas changer BINDIR par une variable quelconque : BINDIR est le dossier dans lequel se trouve l'exécutable invoqué… déplacez pg_config et BINDIR suivera…)
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager