Re: Composite type storage overhead

2019-10-25 Thread George Neuner
On Wed, 23 Oct 2019 21:24:58 +, Laiszner Tamás wrote: Rob Sargent wrote >> Why not use UUID type? > 1. > Although it does not enforce, but the UUID type kind of suggests a > specific interpretation of the data. Of course the documentation says > you are free to use any algorithm to generat

Re: I think that my data is saved correctly, but when printing again, other data appears

2019-10-25 Thread Yessica Brinkmann
Good evening, sorry for the delay in answering. I have a part-time job and I was at it. I understand what you tell me about the "data" value is just a pointer into the tupdesc associated with the SPI result, and that disappears the moment I do SPI_finish (). What I do not understand well is how to

Re: Trying to fetch records only if preceded by at least another one

2019-10-25 Thread Michael Lewis
On Fri, Oct 25, 2019 at 2:20 PM Alexander Farber wrote: > Thank you Michael - > > On Fri, Oct 25, 2019 at 7:28 PM Michael Lewis wrote: > >> But it prints too many records: all moves cross-multiplied with each >>> other. >>> >>> As if I have forgotten to add 1 more condition to the JOIN LATERAL >

Re: Trying to fetch records only if preceded by at least another one

2019-10-25 Thread Alexander Farber
Thank you Michael - On Fri, Oct 25, 2019 at 7:28 PM Michael Lewis wrote: > But it prints too many records: all moves cross-multiplied with each other. >> >> As if I have forgotten to add 1 more condition to the JOIN LATERAL >> > > LIMIT 1 inside your lateral should resolve that. Personally, I'd

Re: Composite type storage overhead

2019-10-25 Thread Michael Lewis
On Thu, Oct 24, 2019 at 3:35 AM Laiszner Tamás wrote: > Actually, this is not such a unique idea: > https://instagram-engineering.com/sharding-ids-at-instagram-1cf5a71e5a5c > > Thanks for the suggestion to split up the primary key into components. But > even going down this way, packing the compo

Re: Quere keep using temporary files

2019-10-25 Thread Tom Lane
rihad writes: > On 10/25/2019 05:49 PM, Tom Lane wrote: >> You'd need to provide a lot more detail about what that query is doing >> for anyone to be able to guess where the temp file usage is coming from. > I just checked and saw that the function "foo_xml_v2" above returns > table. Is this eno

Re: Trying to fetch records only if preceded by at least another one

2019-10-25 Thread Michael Lewis
> > But it prints too many records: all moves cross-multiplied with each other. > > As if I have forgotten to add 1 more condition to the JOIN LATERAL > LIMIT 1 inside your lateral should resolve that. Personally, I'd move that condition to EXISTS condition inside WHERE clause instead. Just a styl

Re: Quere keep using temporary files

2019-10-25 Thread rihad
On 10/25/2019 05:49 PM, Tom Lane wrote: rihad writes: Hi, we frequently run many query involving XML that use a smallish temporary file, despite having increased local work_mem in that transaction to 16GB. FreeBSD's top shows that the memory isn't actually being used - it remains free. Basicall

Re: logical replication - negative bitmapset member not allowed

2019-10-25 Thread Jehan-Guillaume de Rorthais
On Thu, 10 Oct 2019 15:15:46 +0200 Jehan-Guillaume de Rorthais wrote: [...] > Here is a script to reproduce it under version 10, 11 and 12: I investigated on this bug while coming back from pgconf.eu. Bellow what I found so far. The message "negative bitmapset member not allowed" comes from log

Re: I think that my data is saved correctly, but when printing again, other data appears

2019-10-25 Thread Yessica Brinkmann
Thank you so much for your answer. I will be testing the indicated and then I give you return.Best regards,Yessica Brinkmann Mensaje original Asunto: Re: I think that my data is saved correctly, but when printing again, other data appearsDe: Tom Lane Para: Yessica Brinkmann CC: pgsq

Trying to fetch records only if preceded by at least another one

2019-10-25 Thread Alexander Farber
Good evening, for a word game hosted on PostgreSQL 10 I try to find interesting player moves (high score or played all 7 tiles) and generate a "puzzle" images out of them (example: https://imgur.com/a/StnXqoR ) The moves are stored in: words_ru=> \d words_moves

Re: I think that my data is saved correctly, but when printing again, other data appears

2019-10-25 Thread Tom Lane
Yessica Brinkmann writes: > I have a function called get_columnnames, which runs on a Postgresql server > and returns the names of the columns of a table in a Postgresql database. > In the first foreach, in the statement: idxcd-> varattnames [cont] = data; > column names are saved. Those column na

Re: Error building Postgres for Windows

2019-10-25 Thread Tom Lane
Stephan Sandow writes: > i get 3 errors building the postgres server Version 12.0 for windows: >  plperl.obj : error LNK2019: unresolved external symbol "new_ctype" in > Function "plperl_init_interp > ". [C:\postgre_src\postgresql-12.0\plperl.vcxproj] >   plperl.obj : error LNK2019: unresolved

Re: Quere keep using temporary files

2019-10-25 Thread Tom Lane
rihad writes: > Hi, we frequently run many query involving XML that use a smallish > temporary file, despite having increased local work_mem in that > transaction to 16GB. FreeBSD's top shows that the memory isn't actually > being used - it remains free. Basically many such queries are run with

I think that my data is saved correctly, but when printing again, other data appears

2019-10-25 Thread Yessica Brinkmann
Good day, I am doing a thesis from the University. My thesis is the modification of the Gurjeet Index Adviser, to add some features. I have a function called get_columnnames, which runs on a Postgresql server and returns the names of the columns of a table in a Postgresql database. In the first for

Re: Index

2019-10-25 Thread Ravi Krishna
> > I have created indexes with certain set of columns. Now I want to remove one > of the column and add new column. Can this done without dropping the index? > If you intent is to avoid taking that table offline while the index is being built, you can do this: 1. create index concurrently on

Re: Index

2019-10-25 Thread Luca Ferrari
On Fri, Oct 25, 2019 at 7:35 AM Sonam Sharma wrote: > > I have created indexes with certain set of columns. Now I want to remove one > of the column and add new column. Can this done without dropping the index? If you are going to rename the column the answer is yes. If you are going to drop th

Re: Quere keep using temporary files

2019-10-25 Thread Luca Ferrari
On Fri, Oct 25, 2019 at 10:23 AM rihad wrote: > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp92452.1079", size 166518 > STATEMENT: DELETE FROM "foo" WHERE ((col1, col2, col3) in (select col1, > col2, col3 from foo_xml_v2(''))) AND > "foo"."col_id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9)

Error building Postgres for Windows

2019-10-25 Thread Stephan Sandow
Hello, i get 3 errors building the postgres server Version 12.0 for windows:  plperl.obj : error LNK2019: unresolved external symbol "new_ctype" in Function "plperl_init_interp ". [C:\postgre_src\postgresql-12.0\plperl.vcxproj]   plperl.obj : error LNK2019: unresolved external symbol "new_coll

Quere keep using temporary files

2019-10-25 Thread rihad
Hi, we frequently run many query involving XML that use a smallish temporary file, despite having increased local work_mem in that transaction to 16GB. FreeBSD's top shows that the memory isn't actually being used - it remains free. Basically many such queries are run within a single transactio