Re: pg_upgrade & tablespaces

From: Joseph Kregloh <jkregloh(at)sproutloud(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_upgrade & tablespaces
Date: 2013-12-27 14:50:44
Message-ID: CAAW2xffrcSkfBK6v6B3nbS=NRmUum1m33ysFFmQGQ8vmV8dHDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

>
>
>> So how are you moving the 9.0 directory?
>

Just using a mv command like below:
mv /usr/local/pgsql/data /usr/local/pgsql_90/data

Then I recreated the symlinks in /pg_tbspc to point to the new directory
path.

What does a listing for that directory look like after the move?
>

[pgsql(at)postgres-93-upgrade /tmp]$ ls -la /usr/local/pgsql_90/data/
total 97
drwx------ 13 pgsql pgsql 19 Dec 26 21:03 .
drwx------ 3 pgsql pgsql 3 Dec 26 20:43 ..
-rwx------ 1 pgsql pgsql 4 Dec 26 19:30 PG_VERSION
drwx------ 5 pgsql pgsql 5 Dec 26 19:30 base
drwx------ 3 pgsql pgsql 3 Dec 26 19:52 drupal_dbspace
drwx------ 2 pgsql pgsql 43 Dec 26 21:03 global
drwx------ 2 pgsql pgsql 3 Dec 26 19:30 pg_clog
-rwx------ 1 pgsql pgsql 3939 Dec 26 19:30 pg_hba.conf
-rwx------ 1 pgsql pgsql 1636 Dec 26 19:30 pg_ident.conf
drwx------ 4 pgsql pgsql 4 Dec 26 19:30 pg_multixact
drwx------ 2 pgsql pgsql 3 Dec 26 21:02 pg_notify
drwx------ 2 pgsql pgsql 2 Dec 26 21:03 pg_stat_tmp
drwx------ 2 pgsql pgsql 3 Dec 26 19:30 pg_subtrans
drwx------ 2 pgsql pgsql 3 Dec 26 21:00 pg_tblspc
drwx------ 2 pgsql pgsql 2 Dec 26 19:30 pg_twophase
drwx------ 3 pgsql pgsql 6 Dec 26 20:53 pg_xlog
-rwx------ 1 pgsql pgsql 18079 Dec 26 19:43 postgresql.conf
-rwx------ 1 pgsql pgsql 59 Dec 26 19:44 postmaster.log
-rwx------ 1 pgsql pgsql 195 Dec 26 21:02 postmaster.opts
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la
/usr/local/pgsql_90/data/drupal_dbspace/
total 12
drwx------ 3 pgsql pgsql 3 Dec 26 19:52 .
drwx------ 13 pgsql pgsql 19 Dec 26 21:03 ..
drwx------ 3 pgsql pgsql 3 Dec 26 19:52 PG_9.0_201008051
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la
/usr/local/pgsql_90/data/pg_tblspc/
total 9
drwx------ 2 pgsql pgsql 3 Dec 26 21:00 .
drwx------ 13 pgsql pgsql 19 Dec 26 21:03 ..
lrwxr-xr-x 1 pgsql pgsql 39 Dec 26 21:00 24658 ->
/usr/local/pgsql_90/data/drupal_dbspace

> What does a listing for the 9.3 directory look like?
>

This is right after the initdb, I also created the /drupal_dbspace

[pgsql(at)postgres-93-upgrade /tmp]$ ls -la /usr/local/pgsql/data/
total 104
drwx------ 16 pgsql pgsql 20 Dec 27 14:48 .
drwxr-xr-x 3 pgsql pgsql 5 Dec 26 15:17 ..
-rw------- 1 pgsql pgsql 4 Dec 27 14:38 PG_VERSION
drwx------ 5 pgsql pgsql 5 Dec 27 14:39 base
drwxr-xr-x 2 pgsql pgsql 2 Dec 27 14:48 drupal_dbspace
drwx------ 2 pgsql pgsql 42 Dec 27 14:39 global
drwx------ 2 pgsql pgsql 3 Dec 27 14:38 pg_clog
-rw------- 1 pgsql pgsql 4467 Dec 27 14:38 pg_hba.conf
-rw------- 1 pgsql pgsql 1636 Dec 27 14:38 pg_ident.conf
drwx------ 4 pgsql pgsql 4 Dec 27 14:38 pg_multixact
drwx------ 2 pgsql pgsql 3 Dec 27 14:39 pg_notify
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 pg_serial
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 pg_snapshots
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 pg_stat
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 pg_stat_tmp
drwx------ 2 pgsql pgsql 3 Dec 27 14:38 pg_subtrans
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 pg_tblspc
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 pg_twophase
drwx------ 3 pgsql pgsql 4 Dec 27 14:38 pg_xlog
-rw------- 1 pgsql pgsql 20410 Dec 27 14:38 postgresql.conf
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la
/usr/local/pgsql/data/drupal_dbspace/
total 8
drwxr-xr-x 2 pgsql pgsql 2 Dec 27 14:48 .
drwx------ 16 pgsql pgsql 20 Dec 27 14:48 ..
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la /usr/local/pgsql/data/pg_tblspc/

total 8
drwx------ 2 pgsql pgsql 2 Dec 27 14:38 .
drwx------ 16 pgsql pgsql 20 Dec 27 14:48 ..

>>
> So what do the listings for the old and new data directories look like
> after the upgrade?
>
>
Here is the moved 9.0 directory, it's a listing of data, drupal_dbspace,
and pg_tblsp

[pgsql(at)postgres-93-upgrade /tmp]$ ls -la /usr/local/pgsql_90/data/
total 97
drwx------ 13 pgsql pgsql 19 Dec 26 21:03 .
drwx------ 3 pgsql pgsql 3 Dec 26 20:43 ..
-rwx------ 1 pgsql pgsql 4 Dec 26 19:30 PG_VERSION
drwx------ 5 pgsql pgsql 5 Dec 26 19:30 base
drwx------ 3 pgsql pgsql 3 Dec 26 19:52 drupal_dbspace
drwx------ 2 pgsql pgsql 43 Dec 26 21:03 global
drwx------ 2 pgsql pgsql 3 Dec 26 19:30 pg_clog
-rwx------ 1 pgsql pgsql 3939 Dec 26 19:30 pg_hba.conf
-rwx------ 1 pgsql pgsql 1636 Dec 26 19:30 pg_ident.conf
drwx------ 4 pgsql pgsql 4 Dec 26 19:30 pg_multixact
drwx------ 2 pgsql pgsql 3 Dec 26 21:02 pg_notify
drwx------ 2 pgsql pgsql 2 Dec 26 21:03 pg_stat_tmp
drwx------ 2 pgsql pgsql 3 Dec 26 19:30 pg_subtrans
drwx------ 2 pgsql pgsql 3 Dec 26 21:00 pg_tblspc
drwx------ 2 pgsql pgsql 2 Dec 26 19:30 pg_twophase
drwx------ 3 pgsql pgsql 6 Dec 26 20:53 pg_xlog
-rwx------ 1 pgsql pgsql 18079 Dec 26 19:43 postgresql.conf
-rwx------ 1 pgsql pgsql 59 Dec 26 19:44 postmaster.log
-rwx------ 1 pgsql pgsql 195 Dec 26 21:02 postmaster.opts
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la
/usr/local/pgsql_90/data/drupal_dbspace/
total 12
drwx------ 3 pgsql pgsql 3 Dec 26 19:52 .
drwx------ 13 pgsql pgsql 19 Dec 26 21:03 ..
drwx------ 3 pgsql pgsql 3 Dec 26 19:52 PG_9.0_201008051
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la
/usr/local/pgsql_90/data/pg_tblspc/
total 9
drwx------ 2 pgsql pgsql 3 Dec 26 21:00 .
drwx------ 13 pgsql pgsql 19 Dec 26 21:03 ..
lrwxr-xr-x 1 pgsql pgsql 39 Dec 26 21:00 24658 ->
/usr/local/pgsql_90/data/drupal_dbspace

Here is a listing of the 9.3 directory in the default location, same
listings as above:

[pgsql(at)postgres-93-upgrade /tmp]$ ls -la /usr/local/pgsql/data/
total 107
drwx------ 16 pgsql pgsql 21 Dec 26 21:03 .
drwxr-xr-x 3 pgsql pgsql 5 Dec 26 15:17 ..
-rw------- 1 pgsql pgsql 4 Dec 26 21:01 PG_VERSION
drwx------ 5 pgsql pgsql 5 Dec 26 21:01 base
drwx------ 3 pgsql pgsql 3 Dec 26 21:03 drupal_dbspace
drwx------ 2 pgsql pgsql 44 Dec 26 21:03 global
drwx------ 2 pgsql pgsql 3 Dec 26 21:03 pg_clog
-rw------- 1 pgsql pgsql 4467 Dec 26 21:01 pg_hba.conf
-rw------- 1 pgsql pgsql 1636 Dec 26 21:01 pg_ident.conf
drwx------ 4 pgsql pgsql 4 Dec 26 21:01 pg_multixact
drwx------ 2 pgsql pgsql 3 Dec 26 21:03 pg_notify
drwx------ 2 pgsql pgsql 2 Dec 26 21:01 pg_serial
drwx------ 2 pgsql pgsql 2 Dec 26 21:01 pg_snapshots
drwx------ 2 pgsql pgsql 8 Dec 26 21:03 pg_stat
drwx------ 2 pgsql pgsql 2 Dec 26 21:03 pg_stat_tmp
drwx------ 2 pgsql pgsql 3 Dec 26 21:01 pg_subtrans
drwx------ 2 pgsql pgsql 3 Dec 26 21:03 pg_tblspc
drwx------ 2 pgsql pgsql 2 Dec 26 21:01 pg_twophase
drwx------ 3 pgsql pgsql 5 Dec 26 21:03 pg_xlog
-rw------- 1 pgsql pgsql 20411 Dec 26 21:01 postgresql.conf
-rw------- 1 pgsql pgsql 236 Dec 26 21:03 postmaster.opts
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la
/usr/local/pgsql/data/drupal_dbspace/
total 12
drwx------ 3 pgsql pgsql 3 Dec 26 21:03 .
drwx------ 16 pgsql pgsql 21 Dec 26 21:03 ..
drwx------ 3 pgsql pgsql 3 Dec 26 21:03 PG_9.3_201306121
[pgsql(at)postgres-93-upgrade /tmp]$ ls -la /usr/local/pgsql/data/pg_tblspc/

total 9
drwx------ 2 pgsql pgsql 3 Dec 26 21:03 .
drwx------ 16 pgsql pgsql 21 Dec 26 21:03 ..
lrwx------ 1 pgsql pgsql 36 Dec 26 21:03 16420 ->
/usr/local/pgsql/data/drupal_dbspace

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Silberberg 2013-12-27 19:04:31 Web Hosting support for pgsql in PHP
Previous Message Clemens Eisserer 2013-12-27 13:01:01 Why is wal_writer_delay limited to 10s?

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2013-12-27 15:48:14 Re: A GIN index internals question
Previous Message Stephen Frost 2013-12-27 14:15:34 Re: preserving forensic information when we freeze