Re: Duda sobre como imprimir un campo INTERVAL

2022-11-18 Thread Ken Tanzer
On Thu, Nov 17, 2022 at 2:30 PM Alejandro Baeza Rangel < jlabaezaran...@gmail.com> wrote: > Buenas tardes, tengo esta tabla > [image: image.png] > como puedo en un report, representar la columna tiempo > ya que le pongo directo un print y me sale: > [image: image.png] > > alguna sugerencia? > As

Re: Upgrading to v12

2022-11-18 Thread Adrian Klaver
On 11/18/22 16:05, Brad White wrote: tl;dr  How do I turn up the logging so I can see what is failing? In our quest to get replication working, we are upgrading from v9.4 to v12.10. Access365 via ODBC Driver = "PostgreSQL Unicode" v13.02, Date 9/22/2021 In testing the app against v12, I

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Mladen Gogala
On 11/18/22 15:08, Peter J. Holzer wrote: On 2022-11-17 11:36:15 -0800, Bryn Llewellyn wrote: The detail below leads to a simply stated question: Given that the bootstrap superuser must exist, is there ever a reason to create another role with "superuser"? My intuition tells me that the

Re: Upgrading to v12

2022-11-18 Thread Brad White
tl;dr How do I turn up the logging so I can see what is failing? In our quest to get replication working, we are upgrading from v9.4 to v12.10. Access365 via ODBC Driver = "PostgreSQL Unicode" v13.02, Date 9/22/2021 In testing the app against v12, I find this issue: On updating a record, I

Re: Lots of read activity on index only scan

2022-11-18 Thread Peter Geoghegan
On Fri, Nov 18, 2022 at 1:50 PM Peter J. Holzer wrote: > There should be about 27000 of them, same as for the othe index, right? There aren't that many. The point I'm making is that you can access each VM page approximately once (and check relatively many index tuple's TIDs all in one go), or

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Ron
On 11/18/22 16:13, Peter J. Holzer wrote: [snip] So you can give these credentials to you developers or devops folks (whom you trust not attack the system - They like to "fix" things without documenting what they did, and then, when something breaks, denying they did anything (or honestly not

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Peter J. Holzer
On 2022-11-18 13:11:24 -0800, Bryn Llewellyn wrote: > hjp-pg...@hjp.at wrote: > b...@yugabyte.com wrote: > Given that the bootstrap superuser must exist, is there ever a reason > to create > another role with "superuser"? > > My intuition tells me that the

Re: Lots of read activity on index only scan

2022-11-18 Thread Peter J. Holzer
On 2022-11-18 13:09:16 -0800, Peter Geoghegan wrote: > On Fri, Nov 18, 2022 at 12:46 PM Peter J. Holzer wrote: > > Both do a parallel index only scan. Both perform 0 heap fetches. > > But one reads 27336 buffers (or about 22 bytes per index entry, which > > sounds reasonable) while the other

Re: Lots of read activity on index only scan

2022-11-18 Thread Peter J. Holzer
On 2022-11-18 15:59:46 -0500, Tom Lane wrote: > "Peter J. Holzer" writes: > > Both do a parallel index only scan. Both perform 0 heap fetches. > > But one reads 27336 buffers (or about 22 bytes per index entry, which > > sounds reasonable) while the other reads 9995216 buffers (or almost one > >

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Bryn Llewellyn
> hjp-pg...@hjp.at wrote: > > b...@yugabyte.com wrote: > >> The detail below leads to a simply stated question: >> >> Given that the bootstrap superuser must exist, is there ever a reason to >> create >> another role with "superuser"? >> >> My intuition tells me that the answer is a

Re: Lots of read activity on index only scan

2022-11-18 Thread Peter Geoghegan
On Fri, Nov 18, 2022 at 12:46 PM Peter J. Holzer wrote: > Both do a parallel index only scan. Both perform 0 heap fetches. > But one reads 27336 buffers (or about 22 bytes per index entry, which > sounds reasonable) while the other reads 9995216 buffers (or almost one > full buffer per row). Why?

Re: RES: RES: session_user different from current_user after normal login

2022-11-18 Thread Tom Lane
Murillo corvino rocha writes: > \drds > List of settings > Role| Database | Settings > --+--+--- > user1| mydb | role=group_read_only Yeah, that would explain it ... what

Re: RES: RES: session_user different from current_user after normal login

2022-11-18 Thread Adrian Klaver
On 11/18/22 12:52, Murillo corvino rocha wrote: Could it be the role=group_read_only? The fact that user1 is a member of group_read_only is changing current_user variable? Well role=group_read_only means this: psql -d database -h host -U user1 effectively becomes: psql -d

Re: Lots of read activity on index only scan

2022-11-18 Thread Tom Lane
"Peter J. Holzer" writes: > Both do a parallel index only scan. Both perform 0 heap fetches. > But one reads 27336 buffers (or about 22 bytes per index entry, which > sounds reasonable) while the other reads 9995216 buffers (or almost one > full buffer per row). Why? The entries should be dense

Lots of read activity on index only scan

2022-11-18 Thread Peter J. Holzer
This is triggered by Hans-Jürgen Schönig's blog post on B-Tree vs. BRIN indexes here: https://www.cybertec-postgresql.com/en/btree-vs-brin-2-options-for-indexing-in-postgresql-data-warehouses/ He creates a rather large table with a sorted and an unsorted column plus two indexes: CREATE TABLE

Re: Appetite for `SELECT ... EXCLUDE`?

2022-11-18 Thread Nikhil Benesch
Thanks for the pointers, Tom. Sorry my search didn't turn those up. On Fri, Nov 18, 2022 at 3:18 PM Tom Lane wrote: > > Nikhil Benesch writes: > > Both DuckDB and Snowflake, as of recently, support a nonstandard `EXCLUDE` > > clause in the SELECT list to allow excluding fields from a wildcard

Re: Appetite for `SELECT ... EXCLUDE`?

2022-11-18 Thread Tom Lane
Nikhil Benesch writes: > Both DuckDB and Snowflake, as of recently, support a nonstandard `EXCLUDE` > clause in the SELECT list to allow excluding fields from a wildcard [0] [1]. > Example from the DuckDB announcement [2]: >SELECT * EXCLUDE (jar_jar_binks, midichlorians) FROM star_wars >

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Peter J. Holzer
On 2022-11-17 11:36:15 -0800, Bryn Llewellyn wrote: > The detail below leads to a simply stated question: > > Given that the bootstrap superuser must exist, is there ever a reason to > create > another role with "superuser"? > > My intuition tells me that the answer is a resounding "No!". Is

Appetite for `SELECT ... EXCLUDE`?

2022-11-18 Thread Nikhil Benesch
Both DuckDB and Snowflake, as of recently, support a nonstandard `EXCLUDE` clause in the SELECT list to allow excluding fields from a wildcard [0] [1]. Example from the DuckDB announcement [2]: SELECT * EXCLUDE (jar_jar_binks, midichlorians) FROM star_wars Is there any appetite for adding

Re: Calculating average block write time

2022-11-18 Thread Thomas Kellerer
Laurenz Albe schrieb am 18.11.2022 um 16:51: I can easily calculate the average block read time using pg_stat_database and divide blk_read_time by blks_read. While there is a column blk_write_time, it seems that there is no cummulative measure for the total number of blocks written. Any

Re: Calculating average block write time

2022-11-18 Thread Tom Lane
Ron writes: > On 11/18/22 09:51, Laurenz Albe wrote: >> On Fri, 2022-11-18 at 11:11 +0100, Thomas Kellerer wrote: >>> Any ideas on how to get the equivalent of (blk_read_time / blks_read) for >>> blk_write_time? >> You cannot get that, because most writes are done by the checkpointer, and >>

Re: copy databases from two differend backups to one cluster

2022-11-18 Thread Adrian Klaver
On 11/18/22 04:33, Joseph Kennedy wrote: I would like to copy databases from two different pg_basebackup backups to one lab environment database cluster on another server. Is it possible ? It's a good idea to do it in that way. Databases has your oid in pg_basebackup we can find it id in base

Re: Calculating average block write time

2022-11-18 Thread Ron
On 11/18/22 09:51, Laurenz Albe wrote: On Fri, 2022-11-18 at 11:11 +0100, Thomas Kellerer wrote: Thomas Kellerer schrieb am 04.11.2022 um 10:19: I can easily calculate the average block read time using pg_stat_database and divide blk_read_time by blks_read. While there is a column

Re: Calculating average block write time

2022-11-18 Thread Laurenz Albe
On Fri, 2022-11-18 at 11:11 +0100, Thomas Kellerer wrote: > Thomas Kellerer schrieb am 04.11.2022 um 10:19: > > I can easily calculate the average block read time using > > pg_stat_database and divide blk_read_time by blks_read. > > > > While there is a column blk_write_time, it seems that there

Re: copy databases from two differend backups to one cluster

2022-11-18 Thread Ron
On 11/18/22 06:33, Joseph Kennedy wrote: I would like to copy databases from two different pg_basebackup backups to one lab environment database cluster on another server. Is it possible ? It's a good idea to do it in that way. Databases has your oid in pg_basebackup we can find it id in

Re: RES: session_user different from current_user after normal login

2022-11-18 Thread Tom Lane
Murillo corvino rocha writes: > I am just logging in (using psql) and doing the select: SELECT session_user, > current_user; > The PostgreSQL is an AWS RDS 12.12 instance. No script is being executed. No > one besides me is connected to the database. Could it be any server level >

RES: session_user different from current_user after normal login

2022-11-18 Thread Murillo corvino rocha
No, I’m using a clean psql docker container everytime I need to connect to the database like below: docker run -it --rm postgres psql -d database -h host -U user1 Murillo. De: Adrian Klaver Enviado:quinta-feira, 17 de novembro de 2022 19:54 Para: Murillo

RES: session_user different from current_user after normal login

2022-11-18 Thread Murillo corvino rocha
I am just logging in (using psql) and doing the select: SELECT session_user, current_user; The PostgreSQL is an AWS RDS 12.12 instance. No script is being executed. No one besides me is connected to the database. Could it be any server level configuration? I’m pretty sure that few

copy databases from two differend backups to one cluster

2022-11-18 Thread Joseph Kennedy
I would like to copy databases from two different pg_basebackup backups to one lab environment database cluster on another server. Is it possible ? It's a good idea to do it in that way. Databases has your oid in pg_basebackup we can find it id in base directory for example: base/ 1 125859

Re: Calculating average block write time

2022-11-18 Thread Thomas Kellerer
Thomas Kellerer schrieb am 04.11.2022 um 10:19: > I can easily calculate the average block read time using > pg_stat_database and divide blk_read_time by blks_read. > > While there is a column blk_write_time, it seems that there is no > cummulative measure for the total number of blocks written. >