Re: How to set password in psql -h -d -U command line?

2022-04-28 Thread Joao Miguel Ferreira
Hello, I usually use this approach: PGPASSWORD=secret psql -h 127.0.0.1 -p 5432 -U joao mydatabase it has the down side that the password is shown in the command. need to be careful about that aspect On Thu, Apr 28, 2022 at 10:33 AM Shaozhong SHI wrote: > I tried various ways to set password

Re: pg_dump save command in output

2021-10-06 Thread Joao Miguel Ferreira
On Wed, Oct 6, 2021 at 11:40 AM Daniel Gustafsson wrote: > > On 6 Oct 2021, at 12:22, Laurenz Albe wrote: > > > > On Wed, 2021-10-06 at 10:44 +0100, Joao Miguel Ferreira wrote: > >> I would like to try that yes, it would be a pleasure but I have zero > knowledg

Re: pg_dump save command in output

2021-10-06 Thread Joao Miguel Ferreira
On Wed, Oct 6, 2021 at 10:33 AM Daniel Gustafsson wrote: > > On 3 Oct 2021, at 18:56, Joao Miguel Ferreira < > joao.miguel.c.ferre...@gmail.com> wrote: > > > is there a way to ask pg_dump to save a comment in the output file with > the full command it is executing

Re: pg_dump save command in output

2021-10-03 Thread Joao Miguel Ferreira
On Sun, Oct 3, 2021 at 6:03 PM Adrian Klaver wrote: > On 10/3/21 9:56 AM, Joao Miguel Ferreira wrote: > > Hello all, > > > > is there a way to ask pg_dump to save a comment in the output file with > > the full command it is executing ? > > No. > > What info

pg_dump save command in output

2021-10-03 Thread Joao Miguel Ferreira
Hello all, is there a way to ask pg_dump to save a comment in the output file with the full command it is executing ? thank you Joao

Re: ignore tablespace in schema definition queries

2021-04-03 Thread Joao Miguel Ferreira
or SQL Server. > > On Sat, Apr 3, 2021 at 6:59 AM Joao Miguel Ferreira < > joao.miguel.c.ferre...@gmail.com> wrote: > >> Hello all, >> >> I have a big set of migration queries (that I do not control) that I must >> run on my automatic test database, in

ignore tablespace in schema definition queries

2021-04-03 Thread Joao Miguel Ferreira
Hello all, I have a big set of migration queries (that I do not control) that I must run on my automatic test database, in order to set ip up and run tests. These queries create all sorts of things like indexes, tables, and so. But they also include the specification of the tablespace they expect

Re: pass non-formated query to PL function

2021-04-02 Thread Joao Miguel Ferreira
Hi Pavel and Gianni, Thank you for the suggestions and documentation. That is exactly the kind of thing I was looking for. Cool, thx Joao On Fri, Apr 2, 2021 at 10:54 AM Gianni Ceccarelli wrote: > On 2021-04-02 Joao Miguel Ferreira > wrote: > > Is it possible, in PL/pgSQL

pass non-formated query to PL function

2021-04-02 Thread Joao Miguel Ferreira
Hello all, Is it possible, in PL/pgSQL, to pass an argument to a function which is actually a "query skeleton" that the method will "fill in the blanks" and execute it or return it to the caller after ? The caller does not have access to the variables/values that will be used to fill the blanks,

Re: permanent setting of config variables

2021-02-18 Thread Joao Miguel Ferreira
Hi, On Thu, Feb 18, 2021 at 4:05 PM Joe Conway wrote: > On 2/18/21 4:09 AM, Joao Miguel Ferreira wrote: > > I have a few PL/pgSQL functions that use queires like "SHOW > company.product INTO > > _product_name" and "SHOW company.cluster INTO _cluster_numbe

Re: permanent setting of config variables

2021-02-18 Thread Joao Miguel Ferreira
Hi, On Thu, Feb 18, 2021 at 10:52 AM Laurenz Albe wrote: > On Thu, 2021-02-18 at 09:09 +0000, Joao Miguel Ferreira wrote: > > I have a few PL/pgSQL functions that use queires like "SHOW > company.product INTO _product_name" and "SHOW company.cluster INTO > _clus

permanent setting of config variables

2021-02-18 Thread Joao Miguel Ferreira
Hi, I have a few PL/pgSQL functions that use queires like "SHOW company.product INTO _product_name" and "SHOW company.cluster INTO _cluster_number". But these are failing because I don't know how to set those values on a permanent basis, or maybe on startup would also be ok. I did read the "ALTE

Re: append jsonb array to another jsonb array

2021-02-17 Thread Joao Miguel Ferreira
Hi, David, Pavel, Thank you for your indications Joao On Wed, Feb 17, 2021 at 7:50 PM Pavel Stehule wrote: > Hi > > st 17. 2. 2021 v 20:44 odesílatel Joao Miguel Ferreira < > joao.miguel.c.ferre...@gmail.com> napsal: > >> Hello all, >> >> I PL/pgSQL I h

append jsonb array to another jsonb array

2021-02-17 Thread Joao Miguel Ferreira
Hello all, I PL/pgSQL I have a few jsonb variables (instantiated each with an array of objects) and I need to append them to produce the final result. All of them are small in size (max 30 each). We are using Pg 11. Example: a = [ x, y ] b = [ z , w ] result would be [ x, y, z, w ] What would y

identifier will be truncated

2021-02-08 Thread Joao Miguel Ferreira
Hello all, I'm running unit/integration tests on a pg based application. I recently started getting the following indication on the test suite pg client: NOTICE: identifier "y1972_1004_vat_periodic_declaration_suppliers_lines_dupl_c24_liq" will be truncated to "y1972_1004_vat_periodic_declaratio

Re: cant connect to localhost:5432 (but unix socket ok)

2021-02-05 Thread Joao Miguel Ferreira
Hello Jain On Fri, Feb 5, 2021 at 1:16 PM Jain, Ankit wrote: > Did you try modifying the firewall settings ? > > > > Add postgres service to the firewall. If that doesn’t work, explicitly > open the port 5433 in the firewall. > > > Anyway, given these settings, "psql -p 5433 -h localhost" should

Re: cant connect to localhost:5432 (but unix socket ok)

2021-02-04 Thread Joao Miguel Ferreira
On Thu, Feb 4, 2021 at 3:04 PM Joao Miguel Ferreira < joao.miguel.c.ferre...@gmail.com> wrote: > > > On Thu, Feb 4, 2021 at 3:02 PM Joao Miguel Ferreira < > joao.miguel.c.ferre...@gmail.com> wrote: > >> Hi Tom >> >> On Thu, Feb 4, 2021 at 2:50 PM

Re: cant connect to localhost:5432 (but unix socket ok)

2021-02-04 Thread Joao Miguel Ferreira
On Thu, Feb 4, 2021 at 3:02 PM Joao Miguel Ferreira < joao.miguel.c.ferre...@gmail.com> wrote: > Hi Tom > > On Thu, Feb 4, 2021 at 2:50 PM Tom Lane wrote: > >> Joao Miguel Ferreira writes: >> > On Thu, Feb 4, 2021 at 2:26 PM hubert depesz lubaczewski &

Re: cant connect to localhost:5432 (but unix socket ok)

2021-02-04 Thread Joao Miguel Ferreira
Hi Tom On Thu, Feb 4, 2021 at 2:50 PM Tom Lane wrote: > Joao Miguel Ferreira writes: > > On Thu, Feb 4, 2021 at 2:26 PM hubert depesz lubaczewski < > dep...@depesz.com> > > wrote: > >>> My database is not listening on TCP/localhost, desptite it is listening

Re: cant connect to localhost:5432 (but unix socket ok)

2021-02-04 Thread Joao Miguel Ferreira
On Thu, Feb 4, 2021 at 2:26 PM hubert depesz lubaczewski wrote: > On Thu, Feb 04, 2021 at 02:20:10PM +0000, Joao Miguel Ferreira wrote: > > My database is not listening on TCP/localhost, desptite it is listening > on the unix socket. How can I investigate this? > > I could h

cant connect to localhost:5432 (but unix socket ok)

2021-02-04 Thread Joao Miguel Ferreira
Hello all, My database is not listening on TCP/localhost, desptite it is listening on the unix socket. How can I investigate this? I could have done something that is out of my understanding because I have been loading some big pg_dumpall files that might contain administrative changes that I am

Re: permission denied to create and drop user

2021-02-02 Thread Joao Miguel Ferreira
Hi, On Tue, Feb 2, 2021 at 10:30 PM Tom Lane wrote: > Joao Miguel Ferreira writes: > > I have just installed postgresql on Debian stable (from debian apt > > archives). It seems that the postgres user does not have permissions to > > DROP/CREATE USER. I was expecting the

permission denied to create and drop user

2021-02-02 Thread Joao Miguel Ferreira
Hello all, I have just installed postgresql on Debian stable (from debian apt archives). It seems that the postgres user does not have permissions to DROP/CREATE USER. I was expecting the postgres user to be a superuser but something seems weird. my postgres user does not have the usual superuser

Re: pg_dumpall and tablespaces

2021-02-02 Thread Joao Miguel Ferreira
On Tue, Feb 2, 2021 at 5:08 PM Tom Lane wrote: > Adrian Klaver writes: > > On 2/2/21 8:43 AM, Joao Miguel Ferreira wrote: > >> I have a dump file obtained from pg_dumpall on a MAC computer. I need > to > >> load in onto my Linux laptop running postgres. &g

Re: pg_dumpall and tablespaces

2021-02-02 Thread Joao Miguel Ferreira
On Tue, Feb 2, 2021 at 4:52 PM Adrian Klaver wrote: > On 2/2/21 8:43 AM, Joao Miguel Ferreira wrote: > > > I got 2 problems concerning tablespaces: > > a) during the restore step I get lots of errors about the necessity to > > have root permissions to re-create the ta

pg_dumpall and tablespaces

2021-02-02 Thread Joao Miguel Ferreira
Hello all, I have a dump file obtained from pg_dumpall on a MAC computer. I need to load in onto my Linux laptop running postgres. My scenario is software development. I'm trying to load the dump onto my Pg installation running on Linux (and later possibly on Linux over Docker) in order to perfor

Re: plpgsql unit testing and code coverage

2021-01-01 Thread Joao Miguel Ferreira
Hi Philip and Pavel, Thank you for your contributions. Both seem very interesting :) I will look into it Happy New Year Cheers jmf On Thu, Dec 31, 2020 at 3:25 PM Pavel Stehule wrote: > > > čt 31. 12. 2020 v 13:21 odesílatel Joao Miguel Ferreira < > joao.miguel.c.ferre...@gm

plpgsql unit testing and code coverage

2020-12-31 Thread Joao Miguel Ferreira
Hello, I'm a fan of unit testing and related matters but have used it only on client applications, not on database implemented logic. I recently joined a project whit dozens of PL functions and procedures. So, it would be great for me to find a way to execute unit tests on those functions and pro