Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Guillaume Lelarge
Le lun. 25 janv. 2021 à 03:27, Demitri Muna a écrit : > > > On Jan 24, 2021, at 9:03 PM, Guillaume Lelarge > wrote: > > > >> VACUUM FULL unclusters the table?? > > > > It will rebuild the table without sorting the data according to the > index used with CLUSTER (without any sorting actually). >

Re: Can I use Postgres rules to reset session variables before/after queries?

2021-01-24 Thread Tom Lane
Christophe Pettus writes: >> On Jan 24, 2021, at 21:00, Andrew Stuart wrote: >> Can anyone suggest if session variables can be SET/RESET using Postgres >> rules, or optionally perhaps there is a better way to do so? > PostgreSQL poolers generally use the RESET ALL command when reassigning a >

Re: Can I use Postgres rules to reset session variables before/after queries?

2021-01-24 Thread Christophe Pettus
> On Jan 24, 2021, at 21:00, Andrew Stuart wrote: > Can anyone suggest if session variables can be SET/RESET using Postgres > rules, or optionally perhaps there is a better way to do so? PostgreSQL poolers generally use the RESET ALL command when reassigning a session to clear the session

Can I use Postgres rules to reset session variables before/after queries?

2021-01-24 Thread Andrew Stuart
I am using Postgres row level security and I wish to ensure it is not possible for a specific session variable (that holds a tenant id) to remain set in between transactions / queries. The reason is because this is a web application that pools sessions and the session is shared between user web

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Demitri Muna
> On Jan 24, 2021, at 9:03 PM, Guillaume Lelarge wrote: > >> VACUUM FULL unclusters the table?? > > It will rebuild the table without sorting the data according to the index > used with CLUSTER (without any sorting actually). Thank you for the clarification; that’s very helpful. For the

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Guillaume Lelarge
Le lun. 25 janv. 2021 à 02:54, Ron a écrit : > On 1/24/21 7:50 PM, Guillaume Lelarge wrote: > > Hi, > > Le lun. 25 janv. 2021 à 01:38, Demitri Muna a > écrit : > > [snip] > > >> * If I have previously run a CLUSTER command on a table, will future >> VACUUM FULL commands rewrite the table in the

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Ron
On 1/24/21 7:50 PM, Guillaume Lelarge wrote: Hi, Le lun. 25 janv. 2021 à 01:38, Demitri Muna > a écrit : [snip] * If I have previously run a CLUSTER command on a table, will future VACUUM FULL commands rewrite the table in the order specified in the

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Guillaume Lelarge
Hi, Le lun. 25 janv. 2021 à 01:38, Demitri Muna a écrit : > Hi, > > I would like to request a little clarification on the CLUSTER and VACUUM > commands. My use case here (partially) is when my disk runs out of space > and I want to move a table to a newly created tablespace. These questions >

CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Demitri Muna
Hi, I would like to request a little clarification on the CLUSTER and VACUUM commands. My use case here (partially) is when my disk runs out of space and I want to move a table to a newly created tablespace. These questions somewhat overlap. Let’s say I am starting with a table that is not

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-24 Thread Adrian Klaver
On 1/23/21 11:08 PM, Hemil Ruparel wrote: One small note. Aside from the fact that your server is running from a different port, psycopg2 does not support authentication without password afaik. It has bit me twice Some thinking on this made me realize where you could get into this situation.

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-24 Thread Daniele Varrazzo
On Sun, 24 Jan 2021 at 08:09, Hemil Ruparel wrote: > > One small note. Aside from the fact that your server is running from a > different port, psycopg2 does not support authentication without password > afaik. It has bit me twice It is more likely that you have some misunderstanding around

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-24 Thread Adrian Klaver
On 1/23/21 11:08 PM, Hemil Ruparel wrote: One small note. Aside from the fact that your server is running from a different port, psycopg2 does not support authentication without password afaik. It has bit me twice You will need to explain that further as I have not seen that over many years

Re: solved (was plain stupidity) Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-24 Thread Marc
Robert, Otherwise mankind would constantly be in pain ;-) Enjoy the weekend ! Marc On 24 Jan 2021, at 8:13, robert rottermann wrote: thanks a lot. why dos such stupidity not hurt. ? have a nice weekend robert On 24.01.21 08:04, Julien Rouhaud wrote: On Sun, Jan 24, 2021 at 2:58 PM

Re: Need help with trigger

2021-01-24 Thread Condor
On 23-01-2021 23:29, Melvin Davidson wrote: Maybe this example will help. From https://www.postgresql.org/docs/current/sql-insert.html INSERT INTO distributors AS d (did, dname) VALUES (8, 'Anvil Distribution') ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname || ' (formerly ' ||

Re: solved (was plain stupidity) Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-24 Thread Paul Förster
Hi Robert, > On 24. Jan, 2021, at 08:13, robert rottermann wrote: > > thanks a lot. > why dos such stupidity not hurt. ? the human brain does not contain pain generating or transmitting nerve cells, that's why. :-P Cheers, Paul