Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
432" --username "postgres" --no-password --dbname "myname" --create --clean --verbose "dumpfile" the --create in combination with --clean is going to DROP DATABASE and recreate it. I maintain a complete set of tables in my DB. pgAdmin4 is never used here; the resto

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread pf
>>> >>>> Hi, > >> >> Notwithstanding the man page, my take is that the DROP DATABASE statement >> needs to be eliminated at pg_dump creation by pgAdmin4. Taking this to >> that mailing list. > >It just dawned on me you might be doing all of

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
On 2/20/23 11:36, p...@pfortin.com wrote: On Mon, 20 Feb 2023 11:06:34 -0800 Adrian Klaver wrote: On 2/20/23 10:27, p...@pfortin.com wrote: [Still a newbie; but learning fast...] Hi, Notwithstanding the man page, my take is that the DROP DATABASE statement needs to be eliminated at

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
Linux. The other day, I restored his first file with: pg_restore --host "localhost" --port "5432" --username "postgres" --no-password --dbname "myname" --create --clean --verbose "dumpfile" when I saw this: pg_restore: dropping DAT

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread pf
DB is on Linux. >> >> The other day, I restored his first file with: >>pg_restore --host "localhost" --port "5432" --username "postgres" >>--no-password --dbname "myname" --create --clean --verbose "dumpfile&quo

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
port "5432" --username "postgres" --no-password --dbname "myname" --create --clean --verbose "dumpfile" when I saw this: pg_restore: dropping DATABASE myname Command was: DROP DATABASE myname; pg_restore: error: could not execute query: ERROR:

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Tom Lane
p...@pfortin.com writes: > The other day, I restored his first file with: > pg_restore --host "localhost" --port "5432" --username "postgres" > --no-password --dbname "myname" --create --clean --verbose "dumpfile" > Was my 134 table[1] myname DB saved because it was open? Yup. > If the dump

pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread pf
quot; --no-password --dbname "myname" --create --clean --verbose "dumpfile" when I saw this: pg_restore: dropping DATABASE myname Command was: DROP DATABASE myname; pg_restore: error: could not execute query: ERROR: cannot drop the currently open database Digging

Re: Drop Database

2021-03-18 Thread Adrian Klaver
On 3/18/21 3:39 PM, Gustavo FERREYRA wrote: Hello, a request, which may be resolved in another way and I did not see it. When doing a BACKUP plain and using "Include DROP DATABASE statement", could you add by default "IF EXISTS" ? https://www.postgresql.org/docs/12/app-pgdu

Drop Database

2021-03-18 Thread Gustavo FERREYRA
Hello, a request, which may be resolved in another way and I did not see it. When doing a BACKUP plain and using "Include DROP DATABASE statement", could you add by default "IF EXISTS" ? Because when doing a restore, if the database does not exist, it gives an error and you h

Re: `DROP DATABASE RESTRICT` ?

2020-03-04 Thread David G. Johnston
On Wed, Mar 4, 2020 at 6:17 PM Brennan Vincent wrote: > Hello all, > > I was wondering if there is some reason why Postgres doesn't support a > `RESTRICT` option that would refuse to drop a database if it contains > any schemas or objects, similarly to the semantics of `DROP SCHEMA > [...] RESTRI

`DROP DATABASE RESTRICT` ?

2020-03-04 Thread Brennan Vincent
Hello all, I was wondering if there is some reason why Postgres doesn't support a `RESTRICT` option that would refuse to drop a database if it contains any schemas or objects, similarly to the semantics of `DROP SCHEMA [...] RESTRICT`. Is there a fundamental reason not to support it, or is it jus

Re: drop database

2019-10-17 Thread Ron
There are other databases in the cluster. On 10/17/19 5:12 PM, Andrew Kerber wrote: If you are decommissioning the database, why not just rm -rf the whole system? On Thu, Oct 17, 2019 at 4:31 PM Michael Lewis > wrote: Your plan to loop over tables and truncate t

Re: drop database

2019-10-17 Thread pabloa98
Perhaps you want to TRUNCATE TABLEs. That will mitigate any I/O impact On Thu, Oct 17, 2019 at 3:13 PM Andrew Kerber wrote: > If you are decommissioning the database, why not just rm -rf the whole > system? > > On Thu, Oct 17, 2019 at 4:31 PM Michael Lewis wrote: > >> Your plan to loop over ta

Re: drop database

2019-10-17 Thread Andrew Kerber
If you are decommissioning the database, why not just rm -rf the whole system? On Thu, Oct 17, 2019 at 4:31 PM Michael Lewis wrote: > Your plan to loop over tables and truncate them seems great if you are > worried. It seems simple to verify that space is being freed as you go, and > also easy t

Re: drop database

2019-10-17 Thread Michael Lewis
Your plan to loop over tables and truncate them seems great if you are worried. It seems simple to verify that space is being freed as you go, and also easy to change tactics if the need arises. >

Re: drop database

2019-10-17 Thread Julie Nishimura
I think you don't swallow an entire elephant at once, you can choke on it, it is more safe to be eaten piece by piece:) From: Julie Nishimura Sent: Thursday, October 17, 2019 2:19 PM To: Ron ; pgsql-general@lists.postgresql.org Subject: Re: drop database

Re: drop database

2019-10-17 Thread Julie Nishimura
Ive seen some performance degradation on some other RDBMS systems when "drop database" was in progress. We need to drop database which is 16 tb with minimal impact for our end users. There are 32 other databases with hundreds of connections on the same cluster, and I just want to r

Re: Sv: drop database

2019-10-17 Thread Ron
ndreak@[local]:543212.0 andreak=# select pg_size_pretty(pg_database_size('rsm')); ┌┐ │ pg_size_pretty │ ├┤ │ 26 GB  │ └┘ (1 row) andreak@[local]:543212.0 andreak=# \timing Timing is on. andreak@[local]:543212.0 andreak=# drop DA

Sv: drop database

2019-10-17 Thread Andreas Joseph Krogh
På torsdag 17. oktober 2019 kl. 22:44:15, skrev Julie Nishimura < juliez...@hotmail.com >: Guys, can anybody reply if they drop any postgresql database larger than 1 tb and how long did it take? Sorry, I missread you question as 1GB (not TB)... -- Andreas Jose

Sv: drop database

2019-10-17 Thread Andreas Joseph Krogh
eak=# select pg_size_pretty(pg_database_size('rsm')); ┌┐ │ pg_size_pretty │ ├┤ │ 26 GB │ └┘ (1 row) andreak@[local]:5432 12.0 andreak=# \timing Timing is on. andreak@[local]:5432 12.0 andreak=# drop DATABASE rsm; DROP DATA

Re: drop database

2019-10-17 Thread Ron
?  (If I were worried about it -- which I might be -- then I'd put a DROP DATABASE script in crontab and run it from there.) -- Angular momentum makes the world go 'round.

drop database

2019-10-17 Thread Julie Nishimura
Guys, can anybody reply if they drop any postgresql database larger than 1 tb and how long did it take? Thanks