Re: What happened to the tip "It is good practice to create a role that has the CREATEDB and CREATEROLE privileges..."

2023-04-20 Thread Laurenz Albe
On Wed, 2023-04-19 at 16:53 -0700, Bryn Llewellyn wrote: > > I do see that a role that hasĀ "createdb" and "createrole" is pretty powerful > because, > for example, a role with these attributes can use "set role" to become any > other non-superuser > (see the example below). A user with CREATERO

Re: What happened to the tip "It is good practice to create a role that has the CREATEDB and CREATEROLE privileges..."

2023-04-20 Thread Bryn Llewellyn
laurenz.a...@cybertec.at wrote: > >> b...@yugabyte.com wrote: >> >> I do see that a role that has "createdb" and "createrole" is pretty powerful >> because, for example, a role with these attributes can use "set role" to >> become any other non-superuser (see the example below). > > A user wit

missing something about json syntax

2023-04-20 Thread Marc Millas
Hi, postgres 15 looks Iike I am missing something, maybe obvious :-( In a table with a json column (_data) if I ask psql to select _data from mytable with a where clause to get only one line,, I get something beginning by {"time":"2023-04-19T16:28:01.19780551+02:00","stream":"stderr","_p":"F","

Re: missing something about json syntax

2023-04-20 Thread Erik Wienhold
> On 20/04/2023 18:35 CEST Marc Millas wrote: > > Hi, > > postgres 15 > > looks Iike I am missing something, maybe obvious :-( > In a table with a json column (_data) if I ask psql to select _data from > mytable with a where clause to get only one line,, I get something beginning > by > {"time":"2

Re: missing something about json syntax

2023-04-20 Thread Marc Millas
Thanks for your input. select (_data->>'log')::json->'level' from mytable; this does work. but it doesnt explain how postgres is able to put a scalar in a json or jsonb column without pb: I don't understand how this ('"{\"t\"}"') can be considered a valid enough json to be inserted in a json colu

Re: missing something about json syntax

2023-04-20 Thread Tom Lane
Marc Millas writes: > but it doesnt explain how postgres is able to put a scalar in a json or > jsonb column without pb: > I don't understand how this ('"{\"t\"}"') can be considered a valid enough > json to be inserted in a json column > and at the same time invalid for all other json uses. Tha

vacuum TOAST tables

2023-04-20 Thread senor
Hi All, PostgreSQL v11.19-1PGDG.rhel7 (upgrading to 12+ is so far only talk) CentOS 7.9 I see various recommendation for queries to return the tables most in need of a vacuum that exclude the TOAST tables with something like: ...AND n.nspname NOT IN ('pg_toast') My real issue is autovacuum not

Re: vacuum TOAST tables

2023-04-20 Thread Laurenz Albe
On Fri, 2023-04-21 at 04:37 +, senor wrote: > PostgreSQL v11.19-1PGDG.rhel7 (upgrading to 12+ is so far only talk) > CentOS 7.9 > > If I understand correctly, autovacuum handles tables and their associated > TOAST tables separately > but a manual vacuum will also vacuum the TOAST. That is co