Обсуждение: PG-15 - Format problems after jump migration from 9-4 to 15

Поиск
Список
Период
Сортировка

PG-15 - Format problems after jump migration from 9-4 to 15

От
Ennio-Sr
Дата:
Hi all,
it's a long time I did not submit any query as I was happily working with
a database created many years ago with Postgresql-9.4 under Linx/Debian.
As my old PC is falling into pieces I migrated old PG-9.4 clusters to a
brand new PG-15 under Debian-12 on a Beelink Mini Pro 12.

While testing if all was in order I received an unusual warning on one of
the tables, containing instruction like those reported hereunder that I'm
unable to solve. 
Could you please give me some hints to overcome the problem?

Thanks in advance for your help.
Kind regards,
     emmio

-------------------------
§§--> This is one of the code lines in my script, just to give you
§§--> an idea:

usr@deby:~$ minc="`psql mydb -tc "select cast(date_part('month',current_date) as integer);"`"
usr@deby:~$ echo $minc
Target width is 150. Output format is wrapped. 1

§§--> And this is what appears on the screen when I enter 'mydb':

usr@deby:~$ psql mydb
Target width is 150.
Output format is wrapped.
psql (15.10 (Debian 15.10-0+deb12u1))
Type "help" for help.

(§§-> Nothing happens after setting PAGER)

mydb=> \setenv PAGER less
mydb=> \q

usr@deby:~$ minc="`psql mydb -tc "select cast(date_part('month',current_date) as integer);"`"
usr@deby:~$ echo $minc
Target width is 150. Output format is wrapped. 1
usr@deby:~$

-- 
[Perché usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.  \\?//
 Fà qualche cosa di cui non sei capace!"  (diceva Henry Miller)        (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.        .)=(. 
 Do something you aren't good at!" (as Henry Miller used to say)]  /_____\ 



Re: PG-15 - Format problems after jump migration from 9-4 to 15

От
"David G. Johnston"
Дата:
On Fri, Jan 17, 2025 at 6:11 PM Ennio-Sr <nasr.laili@tin.it> wrote:
Could you please give me some hints to overcome the problem?

§§--> And this is what appears on the screen when I enter 'mydb':

usr@deby:~$ psql mydb
Target width is 150.
Output format is wrapped.
psql (15.10 (Debian 15.10-0+deb12u1))
Type "help" for help.


You are executing the corresponding \pset commands for those two options in your .psqlrc file.  For scripts you generally don't want to do that. Either modify your .psqlrc file, or pass -X to your psql command to ignore it.

Otherwise, those should be output on stdout; you can use your shell's tools to send it elsewhere so your output capture doesn't see it.

Modifying "echo" output might also work.

David J.

Re: PG-15 - Format problems after jump migration from 9-4 to 15

От
"David G. Johnston"
Дата:
On Fri, Jan 17, 2025 at 6:25 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
Otherwise, those should be output on stdout;

That should say "stderr".

David J.

Re: PG-15 - Format problems after jump migration from 9-4 to 15

От
Ennio-Sr
Дата:
* David G. Johnston <david.g.johnston@gmail.com> [170125, 18:25]:
> On Fri, Jan 17, 2025 at 6:11 PM Ennio-Sr <nasr.laili@tin.it> wrote:
> 
> > Could you please give me some hints to overcome the problem?
> >
> > §§--> And this is what appears on the screen when I enter 'mydb':
> >
> > usr@deby:~$ psql mydb
> > Target width is 150.
> > Output format is wrapped.
> > psql (15.10 (Debian 15.10-0+deb12u1))
> > Type "help" for help.
> >
> >
> You are executing the corresponding \pset commands for those two options in
> your .psqlrc file.  For scripts you generally don't want to do that. Either
> modify your .psqlrc file, or pass -X to your psql command to ignore it.
> 
> Otherwise, those should be output on stdout; you can use your shell's tools
> to send it elsewhere so your output capture doesn't see it.
> 
> Modifying "echo" output might also work.
> 
> David J.

First of all let me say 'Thank you very much indeed, David, for your help!
It saved ne time, which is becoming more and more precious to me'.

That said, I wonder reading what I could have gasped the answer: I
was using (in PG-15) the same settings I had set - more than 10 years ago
- in PG-9.4, and the troublesome script still works perfectly on my ald PC
  (both, PC and Beelink are running the same Debian version, as shown by
  <# uname -a>).

Thanks again, and I wish you all a wonderful 2025!

     ennio
-- 
[Perché usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.  \\?//
 Fà qualche cosa di cui non sei capace!"  (diceva Henry Miller)        (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.        .)=(. 
 Do something you aren't good at!" (as Henry Miller used to say)]  /_____\ 



Re: PG-15 - Format problems after jump migration from 9-4 to 15

От
"David G. Johnston"
Дата:
On Saturday, January 18, 2025, Ennio-Sr <nasr.laili@tin.it> wrote:

That said, I wonder reading what I could have gasped the answer:

Release notes for 9.6


Specifically the one about -c no longer also applying -X

David J.

Re: PG-15 - Format problems after jump migration from 9-4 to 15

От
Bruce Momjian
Дата:
I have modified David's CC list in the email he sent below since he
removed the original sender, I assume accidentally.

His excellent point is that is Ennio-Sr is jumping eight years of
releases so he has ~1000+ changes to review and decide how they impact
his Postgres usage.  It is easy to see how Ennio-Sr might have missed
the release note item David mentions below.

---------------------------------------------------------------------------

On Sat, Jan 18, 2025 at 09:10:47AM -0700, David G. Johnston wrote:
> On Saturday, January 18, 2025, Ennio-Sr <nasr.laili@tin.it> wrote:
> 
> 
>     That said, I wonder reading what I could have gasped the answer:
> 
> 
> Release notes for 9.6
> 
>  https://www.postgresql.org/docs/9.6/release-9-6.html
> 
> Specifically the one about -c no longer also applying -X
> 
> David J.
> 

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Do not let urgent matters crowd out time for investment in the future.