Dump version issues

2025-04-23 Thread Pawel Veselov
Hello.

Was trying to import a database from a cloud deployment, and ran into this.

Exported the database with:
* pg_dump (PostgreSQL) 12.20 (Ubuntu 12.20-0ubuntu0.20.04.1)
* RDS PostgreSQL 12.19 on x86_64-pc-linux-gnu, compiled by gcc (GCC)
7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit

This produced a dump file of version 1.16, at least according to 'file'.

Trying to import the same dump on another (Fedora) machine, tried:
* pg_restore (PostgreSQL) 12.22 <- from PGDG
* pg_restore (PostgreSQL) 16.8 <- from Fedora

Both complain that they can't process the dump because dump version
1.16 is not supported.
Both packages are latest from their respective repositories.

I'm not sure whether the server has any say in the version of the dump
file, I assume it doesn't.

So, how come older software (according to versions) produces dump
files with a greater version
than the newer software can understand? Is this Ubuntu package
maintainers messing things up?

Given a pg_dump, it would be nice if its "-V" output would say which
version of the dump it would produce,
and a pg_restore - what's the max (and min, if that's a thing) version
of the dump that it will accept.
That would be just super-helpful in finding the right combination of tools.

I ended up running PGDG's 16 pg_dump ((PostgreSQL) 16.8 (Ubuntu
16.8-1.pgdg22.04+1))
on Ubuntu, which produced a 1.15-0 dump.

Thank you,
  Pawel.




Re: Dump version issues

2025-04-23 Thread Pawel Veselov
On Wed, Apr 23, 2025 at 9:13 PM Adrian Klaver  wrote:

> On 4/23/25 11:46, Pawel Veselov wrote:
> > Hello.
>
> > So, how come older software (according to versions) produces dump
> > files with a greater version
> > than the newer software can understand? Is this Ubuntu package
> > maintainers messing things up?
>
> Do:
>
> man postgresql-common
>
> to see how this handled.
>
> I have found that it is best to be explicit using the --cluster option.

Thank you, I would have never guessed.

$ pg_dump -V -h x
pg_dump (PostgreSQL) 17.4 (Ubuntu 17.4-1.pgdg22.04+2)
$ pg_dump -V
pg_dump (PostgreSQL) 12.20 (Ubuntu 12.20-0ubuntu0.20.04.1)

(facepalm)

I was using the latter checking what pg_dump version was actually being used.
Wasn't aware of this pg_wrapper business.

> Given a pg_dump, it would be nice if its "-V" output would say which
> version of the dump it would produce

Yeah, this wouldn't have helped a bit.




Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug

2025-08-20 Thread Pawel Veselov
> > 匀礀渀挀栀爀漀渀漀甀猀 挀漀洀洀椀琀㼀  伀爀 愀猀礀渀挀栀爀漀渀漀甀猀㼀ഀ਀ഀ਀ഀ਀匀挀漀琀 䬀爀攀椀攀渀欀愀洀瀀 簀 䄀瀀瀀氀椀挀愀琀椀漀渀猀 
> > 䤀渀昀爀愀猀琀爀甀挀琀甀爀攀 䄀爀挀栀椀琀攀挀琀 簀 䰀愀ⴀ娀ⴀ䈀漀礀 䌀漀爀瀀漀爀愀琀攀ഀ਀⠀㜀㌀㐀⤀ ㌀㠀㐀ⴀ㘀㐀 ㌀ 簀 
> > ㄀ⴀ㜀㌀㐀ⴀ㤀㄀㔀ⴀ㄀㐀㐀㐀 簀 匀挀漀琀⸀䬀
> This looks like a bug in Outlook (at work) that I ran into over 3 years ago 
> after enabling beta-support for UTF-8 encoding… The fun part was that the 
> messages looked perfectly fine on my end, but were gibberish on the receiving 
> ends only. Is that bug still present perhaps?

Interesting.
Your email client probably incorrectly interprets UTF-16 encoding.
That's what the content charset is in Scott's email.
The first text character in Scott's email is "S" (U0053), but when
sending(?) it translates to 匀 (U5300).

Gmail web also is struggling with it, judging by the spaces I see
between the characters in the Scott's original. Those spaces are
replaced '0x00' chars from the first byte of each UTF-16 char.

>
> Or is it just my end that turns Scott's (and only Scott's) messages into 
> gibberish Chinese?
>
> Alban Hertroys
> --
> There is always an exception to always.
>
>
>
>
>
>


-- 
With best of best regards
Pawel S. Veselov