Re: A simple question about text fields

2021-06-17 Thread Laurenz Albe
On Fri, 2021-06-18 at 10:28 +1000, Gavan Schneider wrote: > On 18 Jun 2021, at 9:34, David G. Johnston wrote: > > On Thursday, June 17, 2021, Gavan Schneider > > wrote: > > > > > My approach is to define such fields as ‘text’ and set a constraint using > > > char_length(). This allows PG to do t

Re: Temporal tables as part of main release

2021-06-17 Thread David G. Johnston
On Thursday, June 17, 2021, Anand Sowmithiran wrote: > I am looking to use the temporal tables feature for keeping track of > changes to my table data. As of now, there is an pgxn.org provided > extension by which we could leverage this functionality, but *when > Temporal tables will become part

Temporal tables as part of main release

2021-06-17 Thread Anand Sowmithiran
I am looking to use the temporal tables feature for keeping track of changes to my table data. As of now, there is an pgxn.org provided extension by which we could leverage this functionality, but *when Temporal tables will become part of the main Postgresql release *[and not as an extension] ? Eve

Re: A simple question about text fields

2021-06-17 Thread Gavan Schneider
On 18 Jun 2021, at 9:34, David G. Johnston wrote: > On Thursday, June 17, 2021, Gavan Schneider > wrote: > >> >> My approach is to define such fields as ‘text’ and set a constraint using >> char_length(). This allows PG to do the business with the text in native >> form, and only imposes the cost

Re: A simple question about text fields

2021-06-17 Thread David G. Johnston
On Thursday, June 17, 2021, Gavan Schneider wrote: > > My approach is to define such fields as ‘text’ and set a constraint using > char_length(). This allows PG to do the business with the text in native > form, and only imposes the cost of any length check when the field is > updated… best of bo

Re: A simple question about text fields

2021-06-17 Thread Gavan Schneider
On 17 Jun 2021, at 1:08, Tom Lane wrote: > Martin Mueller writes: > >> Are there performance issues with the choice of 'text' vs. varchar and some >> character limit? For instance, if I have a table with ten million records >> and text fields that may range in length from 15 to 150, can I expe

Re: Treating float arrays as vectors?

2021-06-17 Thread Paul Jungwirth
On 6/17/21 7:13 AM, Celia McInnis wrote: I would love it if there was a vector data type in postgresql along with such vector operations as addition, subtraction, scalar multiplication, cross product, dot product, normalization, length and various sorts of vector distances. I wrote an extensi

Re: Streaming replication: PANIC on tertiary when secondary promoted

2021-06-17 Thread Alexey Bashtanov
On 16/06/2021 20:31, Alexey Bashtanov wrote: I had it "latest" as well. I'll try to reproduce it again tomorrow. replica -v -d "dbname=postgres port=5432" -U postgres I cannot quite reproduce it artificially. One more piece of detail: in the chain serverA->serverB->serverC->serverD when serv

Re: compute_query_id

2021-06-17 Thread Julien Rouhaud
On Thu, Jun 17, 2021 at 08:57:02PM +0530, Vijaykumar Jain wrote: > > test=# show log_line_prefix; > log_line_prefix > > [timestamp=%t] [query_id=%Q] : > (1 row) > > test=# show compute_query_id; > compute_query_id > -- > on > (1 row) > >

Re: compute_query_id

2021-06-17 Thread Vijaykumar Jain
On Thu, 17 Jun 2021 at 20:20, Julien Rouhaud wrote: > > On Thu, Jun 17, 2021 at 08:09:54PM +0530, Vijaykumar Jain wrote: > > how is the compute_query_id actually calculated? > > > why does it show 0 in logs for random sql queries. > > log_line_prefix = '%Q :' > > 0 :LOG: statement: select * from

Re: compute_query_id

2021-06-17 Thread Julien Rouhaud
On Thu, Jun 17, 2021 at 08:09:54PM +0530, Vijaykumar Jain wrote: > how is the compute_query_id actually calculated? It's the exact same implementation that was extracted from pg_stat_statements. You have some implementation details at https://www.postgresql.org/docs/current/pgstatstatements.html.

compute_query_id

2021-06-17 Thread Vijaykumar Jain
hi, I noticed this new param compute_query_id in pg14beta. it is interesting as I was long wanting to identify a query with a unique id like we have for http requests etc so that we can trace the query all the way to shards via FDW etc. but i cannot see them in the logs even after setting compute

Treating float arrays as vectors?

2021-06-17 Thread Celia McInnis
Hi: I would love it if there was a vector data type in postgresql along with such vector operations as addition, subtraction, scalar multiplication, cross product, dot product, normalization, length and various sorts of vector distances. So far I have been feeding my float arrays to plpython3u to

Re: Listen and notify in psql process

2021-06-17 Thread Torsten Förtsch
On Thu, Jun 17, 2021 at 1:04 PM Sakshi Jain wrote: How to listen from within a psql process and get the payloads? > > Do Postgresql have any such a mechanism where in a session a process send > a "listen " sql command and then gets a message if someone in the > other session issued a "notify ". >

views on partitioned tables

2021-06-17 Thread Holger Vornholt
Hello, we are using several partitioned tables. We regularly encounter the problem, that we would like to help analysts (and ourselves) with joining these tables by building predefined Views. Is it possible to handle the partitions when querying the Views if the tables are hidden in Subqueries?

Re: Listen and notify in psql process

2021-06-17 Thread Ravi Krishna
https://www.postgresql.org/docs/current/sql-notify.html https://www.postgresql.org/docs/13/sql-listen.html

Fwd: Listen and notify in psql process

2021-06-17 Thread Sakshi Jain
Hi Team, How to listen from within a psql process and get the payloads? Do Postgresql have any such a mechanism where in a session a process send a "listen " sql command and then gets a message if someone in the other session issued a "notify ". Please provide an example of how to do this. I am