pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_upgrade
16+ messages / 5 participants
[nested] [flat]
* pg_upgrade
@ 2019-03-18 05:01 Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 16+ messages in thread
From: Tomasz Szypowski @ 2019-03-18 05:01 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
Hello,
while using pg_upgrade I receive an error:
pg_restore: dropping DATABASE template1
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 1955; 1262 1 DATABASE
template1 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop a
template database
Command was: DROP DATABASE "template1";
I have seen, that template-databases can not be dropped. Is it a bug in
pg_upgrade or am I doing something not properly?
regards
Thomas Szypowski
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
@ 2019-03-18 14:33 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Tom Lane @ 2019-03-18 14:33 UTC (permalink / raw)
To: Tomasz Szypowski <tomasz.szypowski@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> while using pg_upgrade I receive an error:
> pg_restore: dropping DATABASE template1
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 1955; 1262 1 DATABASE
> template1 postgres
> pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop a
> template database
> Command was: DROP DATABASE "template1";
Hmmm ... I could believe this would happen if you've removed the
is_template marking from template1 in the source installation.
That doesn't seem like a terribly good idea though, so I'm not
inclined to try to figure a way for pg_dump to work around it.
regards, tom lane
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-03-18 20:55 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 16+ messages in thread
From: Tomasz Szypowski @ 2019-03-18 20:55 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
Hi Tom,
thanks for the response. After initdb tempate1 has datistemplate as true
and in the pg_upgrade.c is:
/*
* template1 and postgres databases will already exist in the target
* installation, so tell pg_restore to drop and recreate them;
* otherwise we would fail to propagate their database-level
* properties.
*/
create_opts = "--clean --create";
regards
Thomas Szypowski
pon., 18 mar 2019 o 15:33 Tom Lane <tgl@sss.pgh.pa.us> napisał(a):
> Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> > while using pg_upgrade I receive an error:
>
> > pg_restore: dropping DATABASE template1
> > pg_restore: [archiver (db)] Error while PROCESSING TOC:
> > pg_restore: [archiver (db)] Error from TOC entry 1955; 1262 1 DATABASE
> > template1 postgres
> > pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop
> a
> > template database
> > Command was: DROP DATABASE "template1";
>
> Hmmm ... I could believe this would happen if you've removed the
> is_template marking from template1 in the source installation.
>
> That doesn't seem like a terribly good idea though, so I'm not
> inclined to try to figure a way for pg_dump to work around it.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
@ 2019-03-18 21:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:05 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Tom Lane @ 2019-03-18 21:58 UTC (permalink / raw)
To: Tomasz Szypowski <tomasz.szypowski@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> thanks for the response. After initdb tempate1 has datistemplate as true
Right, initdb leaves it set that way, but I'm guessing that it's not
like that in the database you're trying to pg_upgrade.
regards, tom lane
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-03-18 22:05 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:37 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 16+ messages in thread
From: Tomasz Szypowski @ 2019-03-18 22:05 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
So what set it to false?
Suppose I have created cluster in 9.5. Template1 has set template flag. Now
I upgrade it to 11.2, so I created cluster on 11.2 by initdb,. Here
template1 has set template flag as well. Now I do perform pg_upgrade and
both template1 are template. Should I manually unset the flag? If yes how
would it be possible to perform pg_upgrade without unsetting the flag -
there is no such point in instruction
Regards
Thomas Szypowski
W dniu pon., 18.03.2019 o 22:58 Tom Lane <tgl@sss.pgh.pa.us> napisał(a):
> Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> > thanks for the response. After initdb tempate1 has datistemplate as true
>
> Right, initdb leaves it set that way, but I'm guessing that it's not
> like that in the database you're trying to pg_upgrade.
>
> regards, tom lane
>
--
pozdrawiam
Tomek
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:05 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
@ 2019-03-18 22:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:43 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Tom Lane @ 2019-03-18 22:37 UTC (permalink / raw)
To: Tomasz Szypowski <tomasz.szypowski@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> So what set it to false?
I was hoping you'd tell me ;-). If it's not false in the old cluster,
though, that theory is all wet.
I wonder if you're somehow using the wrong version of pg_upgrade or
pg_dump. There are cross-checks about that in pg_upgrade, but it
looks like they only check the major version number --- if we'd changed
anything about this in a minor release (which I think we did), it might
be possible to get burnt if you were using pg_upgrade or pg_dump from a
prior minor release. What are all the versions involved, exactly?
regards, tom lane
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:05 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:37 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-03-18 22:43 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:54 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 16+ messages in thread
From: Tomasz Szypowski @ 2019-03-18 22:43 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
As far as I remember pg_upgrade is from 11.2 rest is from 9.5. This is due
to the fact, that the version is secured, only md5, md5 hashed and so on. I
compared the code and didn’t see much difference in pg_upgrade core, but
give me some days and I will test it using binaries from 11.2
Regards
Thomas
W dniu pon., 18.03.2019 o 23:37 Tom Lane <tgl@sss.pgh.pa.us> napisał(a):
> Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> > So what set it to false?
>
> I was hoping you'd tell me ;-). If it's not false in the old cluster,
> though, that theory is all wet.
>
> I wonder if you're somehow using the wrong version of pg_upgrade or
> pg_dump. There are cross-checks about that in pg_upgrade, but it
> looks like they only check the major version number --- if we'd changed
> anything about this in a minor release (which I think we did), it might
> be possible to get burnt if you were using pg_upgrade or pg_dump from a
> prior minor release. What are all the versions involved, exactly?
>
> regards, tom lane
>
--
pozdrawiam
Tomek
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:05 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:37 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:43 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
@ 2019-03-18 22:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-19 08:09 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Tom Lane @ 2019-03-18 22:54 UTC (permalink / raw)
To: Tomasz Szypowski <tomasz.szypowski@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> As far as I remember pg_upgrade is from 11.2 rest is from 9.5.
If you're not certain, run each program with the --version switch
to find out. But pg_upgrade should be refusing to use pg_dump
et al that aren't from its own major version.
regards, tom lane
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:05 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:37 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:43 ` Re: pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:54 ` Re: pg_upgrade Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-03-19 08:09 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
0 siblings, 0 replies; 16+ messages in thread
From: Tomasz Szypowski @ 2019-03-19 08:09 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
Yes, generalny i use 11.4 bins, but libpq, dump, dumpall, restore and psql
are old ones.
Nów I have made the test with original 9.5.16 to 10.2 and it succeeded. If
it is the binary version problem, I´m a little bit surprised, because I
havent´s seen it in a code.
If it is the only bug, that you have, so please do not change code, due to
my problem :-). I ´ll do my test one more time, this time with 11.2
binaries. Will let you then know.
regards
Thomas
W dniu pon., 18.03.2019 o 23:54 Tom Lane <tgl@sss.pgh.pa.us> napisał(a):
> Tomasz Szypowski <tomasz.szypowski@gmail.com> writes:
> > As far as I remember pg_upgrade is from 11.2 rest is from 9.5.
>
> If you're not certain, run each program with the --version switch
> to find out. But pg_upgrade should be refusing to use pg_dump
> et al that aren't from its own major version.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 16+ messages in thread
* pg_upgrade
@ 2019-12-25 13:10 Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Загороднев Роман Евгеньевич @ 2019-12-25 13:10 UTC (permalink / raw)
To: pgsql-bugs
Hi.
On windows pg_upgrade.exe ignores –k (--link) options and try to copy all data.
Pg_upgrade version 10.10.
С уважением,
Роман Евгеньевич Загороднев
Главный системный администратор
НПФ «БУДУЩЕЕ»
+7(495)995-30-37 доб. 4590
Москва, Цветной бульвар, д.2, подъезд D
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
@ 2019-12-25 14:30 ` Julien Rouhaud <rjuju123@gmail.com>
2019-12-25 15:26 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
0 siblings, 1 reply; 16+ messages in thread
From: Julien Rouhaud @ 2019-12-25 14:30 UTC (permalink / raw)
To: Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>; +Cc: pgsql-bugs
On Wed, Dec 25, 2019 at 3:17 PM Загороднев Роман Евгеньевич
<re.zagorodnev@npff.ru> wrote:
>
> Hi.
>
> On windows pg_upgrade.exe ignores –k (--link) options and try to copy all data.
>
> Pg_upgrade version 10.10.
This should not be happening. On windows pg_upgrade uses
CreateHardLinkA()
(https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createhardlinka?redirectedfrom...)
if -k / --link option is used. The page mentions that only ntfs
filesystem is supported, is this what you're using? Can you show the
full output of pg_upgrade in verbose mode?
^ permalink raw reply [nested|flat] 16+ messages in thread
* RE: pg_upgrade
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
@ 2019-12-25 15:26 ` Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 16:04 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Загороднев Роман Евгеньевич @ 2019-12-25 15:26 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: pgsql-bugs
FS - NTFS.
Used different version (10, 12) and result always the same. In log I see that links was created. But pg_upgrade copies all databases. In destination data folder I see files, not links, and if no free space on disk for copy all data, error appear while upgrade.
-----Original Message-----
From: Julien Rouhaud [mailto:rjuju123@gmail.com]
Sent: Wednesday, December 25, 2019 5:31 PM
To: Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_upgrade
On Wed, Dec 25, 2019 at 3:17 PM <re.zagorodnev@npff.ru> wrote:
>
> Hi.
>
> On windows pg_upgrade.exe ignores –k (--link) options and try to copy all data.
>
> Pg_upgrade version 10.10.
This should not be happening. On windows pg_upgrade uses
CreateHardLinkA()
(https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createhardlinka?redirectedfrom...)
if -k / --link option is used. The page mentions that only ntfs filesystem is supported, is this what you're using? Can you show the full output of pg_upgrade in verbose mode?
Attachments:
pg_upgrade_internal.log (application/octet-stream, 561.3K) download
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
2019-12-25 15:26 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
@ 2019-12-25 16:04 ` Julien Rouhaud <rjuju123@gmail.com>
2019-12-27 12:41 ` Re: pg_upgrade Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Julien Rouhaud @ 2019-12-25 16:04 UTC (permalink / raw)
To: Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>; +Cc: pgsql-bugs
On Wed, Dec 25, 2019 at 4:26 PM Загороднев Роман Евгеньевич
<re.zagorodnev@npff.ru> wrote:
>
> FS - NTFS.
> Used different version (10, 12) and result always the same. In log I see that links was created. But pg_upgrade copies all databases. In destination data folder I see files, not links, and if no free space on disk for copy all data, error appear while upgrade.
Unfortunately, I have no idea what encoding you used, so I can't read
the file. I tried some windows encoding but no luck, can you send the
file in utf8 or mention which encoding you're using? Could you also
specify the full pg_upgrade command line you're using?
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
2019-12-25 15:26 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 16:04 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
@ 2019-12-27 12:41 ` Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
2019-12-30 11:46 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
0 siblings, 1 reply; 16+ messages in thread
From: Juan José Santamaría Flecha @ 2019-12-27 12:41 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>; pgsql-bugs
On Wed, Dec 25, 2019 at 5:03 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
> On Wed, Dec 25, 2019 at 4:26 PM Загороднев Роман Евгеньевич
> <re.zagorodnev@npff.ru> wrote:
> >
> > FS - NTFS.
> > Used different version (10, 12) and result always the same. In log I see
> that links was created. But pg_upgrade copies all databases. In destination
> data folder I see files, not links, and if no free space on disk for copy
> all data, error appear while upgrade.
>
> Unfortunately, I have no idea what encoding you used, so I can't read
> the file. I tried some windows encoding but no luck, can you send the
> file in utf8 or mention which encoding you're using? Could you also
> specify the full pg_upgrade command line you're using?
>
>
Hard links are not easy to distinguish from regular files in Windows.
If you identify a file path from a relation in a user database, like so:
test=# select pg_relation_filepath(c.relname::text) from pg_class c
test-# join pg_namespace n on n.oid = c.relnamespace
test-# where n.nspname not in ('information_schema', 'pg_catalog') and
c.relkind = 'r' limit 1;
pg_relation_filepath
----------------------
base/16384/16385
(1 row)
And then check the links of this file:
C:\> fsutil hardlink list %PGDATA%/base/16384/16385
You should see two locations. Can you please confirm this?
Regards,
Juan José Santamaría Flecha
^ permalink raw reply [nested|flat] 16+ messages in thread
* RE: pg_upgrade
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
2019-12-25 15:26 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 16:04 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
2019-12-27 12:41 ` Re: pg_upgrade Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
@ 2019-12-30 11:46 ` Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-31 11:22 ` Re: pg_upgrade Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Загороднев Роман Евгеньевич @ 2019-12-30 11:46 UTC (permalink / raw)
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>; Julien Rouhaud <rjuju123@gmail.com>; +Cc: pgsql-bugs
Thanks for reply.
I performed some tests: fresh install windows server 2016 vm, postgres 9.4 and 12 install. One db on 9.4.
Upgrade command:
SET PGPASSWORD=postgres
C:\PostgreSQL\12\bin\pg_upgrade.exe -b "C:\PostgreSQL\9.4\bin" -B "C:\PostgreSQL\12\bin" -d "C:\PostgreSQL\9.4\data" -D "C:\PostgreSQL\12\data" -k -v -U postgres
Pg_upgrade output:
… linking "C:/PostgreSQL/9.4/data/base/16393/12092" to "C:/PostgreSQL/12/data/base/16410/2613"
linking "C:/PostgreSQL/9.4/data/base/16393/12092_fsm" to "C:/PostgreSQL/12/data/base/16410/2613_fsm"
linking "C:/PostgreSQL/9.4/data/base/16393/12094" to "C:/PostgreSQL/12/data/base/16410/2683"
linking "C:/PostgreSQL/9.4/data/base/16393/16394" to "C:/PostgreSQL/12/data/base/16410/16394"
linking "C:/PostgreSQL/9.4/data/base/16393/16394_fsm" to "C:/PostgreSQL/12/data/base/16410/16394_fsm"
linking "C:/PostgreSQL/9.4/data/base/16393/16401" to "C:/PostgreSQL/12/data/base/16410/16401"
linking "C:/PostgreSQL/9.4/data/base/16393/16401_fsm" to "C:/PostgreSQL/12/data/base/16410/16401_fsm"
Fsutil shows only one location:
C:\>fsutil hardlink list C:\PostgreSQL\12\data\base\16410\1249_vm
\PostgreSQL\12\data\base\16410\1249_vm
C:\>fsutil hardlink list C:\PostgreSQL\12\data\base\16410\113
\PostgreSQL\12\data\base\16410\113
In windows hard links created with mklink. Hardlink can be created only for files.
On the same server I create hardlink for file:
C:\Temp>mklink /H link_pg.cmd c:\Scripts\pg_upgrade.cmd
Hardlink created for link_pg.cmd <<===>> c:\Scripts\pg_upgrade.cmd
And fsutil shows two locations:
C:\Temp>fsutil hardlink list link_pg.cmd
\Scripts\pg_upgrade.cmd
\Temp\link_pg.cmd
In properties of file link_pg.cmd Size on disk are 0.
File properties in data directory:
[cid:image003.jpg@01D5BF1F.DC6314F0]
С уважением,
Роман Загороднев
From: Juan José Santamaría Flecha [mailto:juanjo.santamaria@gmail.com]
Sent: Friday, December 27, 2019 3:41 PM
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>; pgsql-bugs@postgresql.org
Subject: Re: pg_upgrade
On Wed, Dec 25, 2019 at 5:03 PM Julien Rouhaud <rjuju123@gmail.com<mailto:rjuju123@gmail.com>> wrote:
On Wed, Dec 25, 2019 at 4:26 PM Загороднев Роман Евгеньевич
<re.zagorodnev@npff.ru<mailto:re.zagorodnev@npff.ru>> wrote:
>
> FS - NTFS.
> Used different version (10, 12) and result always the same. In log I see that links was created. But pg_upgrade copies all databases. In destination data folder I see files, not links, and if no free space on disk for copy all data, error appear while upgrade.
Unfortunately, I have no idea what encoding you used, so I can't read
the file. I tried some windows encoding but no luck, can you send the
file in utf8 or mention which encoding you're using? Could you also
specify the full pg_upgrade command line you're using?
Hard links are not easy to distinguish from regular files in Windows.
If you identify a file path from a relation in a user database, like so:
test=# select pg_relation_filepath(c.relname::text) from pg_class c
test-# join pg_namespace n on n.oid = c.relnamespace
test-# where n.nspname not in ('information_schema', 'pg_catalog') and c.relkind = 'r' limit 1;
pg_relation_filepath
----------------------
base/16384/16385
(1 row)
And then check the links of this file:
C:\> fsutil hardlink list %PGDATA%/base/16384/16385
You should see two locations. Can you please confirm this?
Regards,
Juan José Santamaría Flecha
Attachments:
image003.jpg (image/jpeg, 38.1K) download
view image
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: pg_upgrade
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
2019-12-25 15:26 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 16:04 ` Re: pg_upgrade Julien Rouhaud <rjuju123@gmail.com>
2019-12-27 12:41 ` Re: pg_upgrade Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
2019-12-30 11:46 ` RE: pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
@ 2019-12-31 11:22 ` Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
0 siblings, 0 replies; 16+ messages in thread
From: Juan José Santamaría Flecha @ 2019-12-31 11:22 UTC (permalink / raw)
To: Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; pgsql-bugs
On Mon, Dec 30, 2019 at 12:46 PM Загороднев Роман Евгеньевич <
re.zagorodnev@npff.ru> wrote:
>
>
> Fsutil shows only one location:
>
> C:\>fsutil hardlink list C:\PostgreSQL\12\data\base\16410\1249_vm
>
> \PostgreSQL\12\data\base\16410\1249_vm
>
>
>
> C:\>fsutil hardlink list C:\PostgreSQL\12\data\base\16410\113
>
> \PostgreSQL\12\data\base\16410\113
>
>
>
Not every relation is linked during the upgrade, the catalog of the greater
version is new and independent from the older version, as you are testing.
So some overhead is expected, you will need available disk space to fit
that.
Regards,
Juan José Santamaría Flecha
Attachments:
image003.jpg (image/jpeg, 38.1K) download
view image
^ permalink raw reply [nested|flat] 16+ messages in thread
end of thread, other threads:[~2019-12-31 11:22 UTC | newest]
Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18 05:01 pg_upgrade Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 14:33 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 20:55 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 21:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:05 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-18 22:43 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-03-18 22:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-19 08:09 ` Tomasz Szypowski <tomasz.szypowski@gmail.com>
2019-12-25 13:10 pg_upgrade Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 14:30 ` Julien Rouhaud <rjuju123@gmail.com>
2019-12-25 15:26 ` Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-25 16:04 ` Julien Rouhaud <rjuju123@gmail.com>
2019-12-27 12:41 ` Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
2019-12-30 11:46 ` Загороднев Роман Евгеньевич <re.zagorodnev@npff.ru>
2019-12-31 11:22 ` Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox