Обсуждение: documentation udpates to pgupgrade.html
Hello, just doing an upgrade form PostgreSQL 8.4.4 on Windows 2007 64bit to PostgreSQL 9.0 64bit on the same system. I am working along http://developer.postgresql.org/pgdocs/postgres/pgupgrade.html There is written: NET STOP postgresql-8.4 NET STOP postgresql-9.0 or NET STOP pgsql-8.3 (PostgreSQL 8.3 and older used a different service name) which should be extended by net stop postgresql-x64-9.0 for Windows 64 bit. ----------------- It would also be helpfull, if there was a reamrk that pg_upgrade will try to write to the current directory - as "runas /user:postgres cmd.exe" usually starts within c:\windows\system; so a cd %TEMP% after runas would be valuable ----------------- -- GHUM GmbH Harald Armin Massa Spielberger Straße 49 70435 Stuttgart 0173/9409607 Amtsgericht Stuttgart, HRB 734971 - persuadere. et programmare
Massa, Harald Armin wrote: > Hello, > > just doing an upgrade form PostgreSQL 8.4.4 on Windows 2007 64bit to > PostgreSQL 9.0 64bit on the same system. > > I am working along > http://developer.postgresql.org/pgdocs/postgres/pgupgrade.html > > There is written: > > NET STOP postgresql-8.4 > NET STOP postgresql-9.0 > or > > NET STOP pgsql-8.3 (PostgreSQL 8.3 and older used a different service name) > > which should be extended by > > net stop postgresql-x64-9.0 > > for Windows 64 bit. > Interesting. What I have added to HEAD and 9.0 docs is the attached patch that explains the proper service name should be used. I don't think I want to mention 64-bit explicitly, and in fact this section is part of an 'e.g.' block, meaning they are just examples. If I get more 64-bit reports I can add an example for that too. > ----------------- > > It would also be helpfull, if there was a reamrk that pg_upgrade will > try to write to the current directory - as "runas /user:postgres > cmd.exe" usually starts within c:\windows\system; so a cd %TEMP% after > runas would be valuable Agreed. Second patch attached that mentions this. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + diff --git a/doc/src/sgml/pgupgrade.sgml b/doc/src/sgml/pgupgrade.sgml index 7bc939c..47c7bf6 100644 --- a/doc/src/sgml/pgupgrade.sgml +++ b/doc/src/sgml/pgupgrade.sgml @@ -246,14 +246,14 @@ gmake prefix=/usr/local/pgsql.new install <title>Stop both servers</title> <para> - Make sure both database servers are stopped using on Unix, e.g.: + Make sure both database servers are stopped using, on Unix, e.g.: <programlisting> pg_ctl -D /opt/PostgreSQL/8.4 stop pg_ctl -D /opt/PostgreSQL/9.0 stop </programlisting> - or on Windows + or on Windows, using the proper service names: <programlisting> NET STOP postgresql-8.4 diff --git a/doc/src/sgml/pgupgrade.sgml b/doc/src/sgml/pgupgrade.sgml index 47c7bf6..6d2cdaa 100644 --- a/doc/src/sgml/pgupgrade.sgml +++ b/doc/src/sgml/pgupgrade.sgml @@ -272,7 +272,7 @@ NET STOP pgsql-8.3 (<productname>PostgreSQL</> 8.3 and older used a different s <title>Run <application>pg_upgrade</></title> <para> - Always run the <application>pg_upgrade</> binary in the new server, not the old one. + Always run the <application>pg_upgrade</> binary of the new server, not the old one. <application>pg_upgrade</> requires the specification of the old and new cluster's data and executable (<filename>bin</>) directories. You can also specify separate user and port values, and whether you want the data linked instead of @@ -306,6 +306,7 @@ pg_upgrade.exe to perform only the checks, even if the old server is still running. <command>pg_upgrade --check</> will also outline any manual adjustments you will need to make after the migration. + <command>pg_upgrade</> requires write permission in the current directory. </para> <para>
Bruce,
GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
Amtsgericht Stuttgart, HRB 734971
-
persuadere.
et programmare
>
> NET STOP postgresql-8.4
> NET STOP postgresql-9.0
> which should be extended byInteresting. What I have added to HEAD and 9.0 docs is the attached
>
> net stop postgresql-x64-9.0
>
> for Windows 64 bit.
>
patch that explains the proper service name should be used. I don't
think I want to mention 64-bit explicitly, and in fact this section is
part of an 'e.g.' block, meaning they are just examples.
yes, they are only examples ... just saying that with one additional example you could have all the fitting PostgreSQLs on Windows covered :) ...
especially as learning about the correct service name is quite a nuisance (it gets named magically in a sensible fassion via the one click installer; it at least requires bringing up the service control panel and search for sth looking like PostgreSQL)
Harald
--
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
Amtsgericht Stuttgart, HRB 734971
-
persuadere.
et programmare
Massa, Harald Armin wrote: > Bruce, > > > > > > NET STOP postgresql-8.4 > > > NET STOP postgresql-9.0 > > > > > > > which should be extended by > > > > > > net stop postgresql-x64-9.0 > > > > > > for Windows 64 bit. > > > > > > > Interesting. What I have added to HEAD and 9.0 docs is the attached > > patch that explains the proper service name should be used. I don't > > think I want to mention 64-bit explicitly, and in fact this section is > > part of an 'e.g.' block, meaning they are just examples. > > > yes, they are only examples ... just saying that with one additional example > you could have all the fitting PostgreSQLs on Windows covered :) ... > > especially as learning about the correct service name is quite a nuisance > (it gets named magically in a sensible fassion via the one click installer; > it at least requires bringing up the service control panel and search for > sth looking like PostgreSQL) Can we document an easy way to find the service names? -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +
Bruce, To query for Postgresql services on Windows use: sc query type= service | find "postgresql" On my machine this yields: SERVICE_NAME: postgresql-9.0 DISPLAY_NAME: postgresql-9.0 - PostgreSQL Server 9.0 NB the space after type= is very important, don't ask me why... I prefer to use 'sc start <servicename>' and 'sc stop <servicename>', then you can use one tool for everything. The following shows these commands (and the query command) in action. C:\Documents and Settings\Administrator>sc stop postgresql-9.0 SERVICE_NAME: postgresql-9.0 TYPE : 10 WIN32_OWN_PROCESS STATE : 3 STOP_PENDING (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x2 WAIT_HINT : 0x2710 C:\Documents and Settings\Administrator>sc start postgresql-9.0 SERVICE_NAME: postgresql-9.0 TYPE : 10 WIN32_OWN_PROCESS STATE : 2 START_PENDING (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x7d0 PID : 3732 FLAGS : C:\Documents and Settings\Administrator>sc query postgresql-9.0 SERVICE_NAME: postgresql-9.0 TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 Hope this isn't too much info and answers all your questions :-) Regards, Colin
Colin,
--
GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
Amtsgericht Stuttgart, HRB 734971
-
persuadere.
et programmare
To query for Postgresql services on Windows use:
sc query type= service | find "postgresql"
sad news is that (at least on my computer) it only finds running services.
Harald
GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
Amtsgericht Stuttgart, HRB 734971
-
persuadere.
et programmare
Oops. Apparently type= service is the default, so we can remove that bit. Then we should add state= all. The default = active, a third option = inactive. So: sc query state= all should list all services, in all states. And then we pipe to find which is the Windows equivalent of grep, but it needs to have its parameter in double quotes. So: sc query state= all | find "postgresql" Regards, Colin On 29 September 2010 19:26, Massa, Harald Armin <chef@ghum.de> wrote: > Colin, > >> >> To query for Postgresql services on Windows use: >> >> sc query type= service | find "postgresql" > > sad news is that (at least on my computer) it only finds running services. > > Harald > > -- > GHUM GmbH > Harald Armin Massa > Spielberger Straße 49 > 70435 Stuttgart > 0173/9409607 > > Amtsgericht Stuttgart, HRB 734971 > - > persuadere. > et programmare >