Re: Size of the table is growing abnormally in my database.

2018-08-25 Thread Raghavendra Rao J S V
Ok, thanks. On Sun 26 Aug, 2018, 10:46 AM Paul Carlucci, wrote: > There's a handful of hidden columns like Xmin and Xmax per row that you're > not accounting for, header info per page, reserve space, free space... The > physical size on disk is reasonable. > > Otherwise you can reduce the number

Re: Size of the table is growing abnormally in my database.

2018-08-25 Thread Paul Carlucci
There's a handful of hidden columns like Xmin and Xmax per row that you're not accounting for, header info per page, reserve space, free space... The physical size on disk is reasonable. Otherwise you can reduce the number of rows by cleaning up and moving out old data, reduce the width of each ro

Re: Size of the table is growing abnormally in my database.

2018-08-25 Thread Raghavendra Rao J S V
Thank you very much for your prompt response. Please guide me below things. How to check rows got corrupted? How to check table got corrupted? How to check which row is occupied more space in the table? Is this expected? [image: image.png] On Sun, 26 Aug 2018 at 09:46, Adrian Klaver wrote:

pg_dump order of operation

2018-08-25 Thread Ron
Hi, In v8.4, I noticed that the tables seemed to be dumped in alphabetical order.  Not so much, though, in a multithreaded 9.6 dump of an 8.4 database; there's no pattern that I can discern. In what order does the 9.6 pg_dump dump tables? Thanks -- Angular momentum makes the world go 'round

Re: Size of the table is growing abnormally in my database.

2018-08-25 Thread Adrian Klaver
On 08/25/2018 08:36 PM, Raghavendra Rao J S V wrote: Hi All, One of our database size is 50gb. Out of it one of the table has 149444622 records. Size of that table is 14GB and its indexes size is 16GB. Total size of the table and its indexes are 30GB. I have perfomred the below steps on that t

Size of the table is growing abnormally in my database.

2018-08-25 Thread Raghavendra Rao J S V
Hi All, One of our database size is 50gb. Out of it one of the table has 149444622 records. Size of that table is 14GB and its indexes size is 16GB. Total size of the table and its indexes are 30GB. I have perfomred the below steps on that table. reindex table table_name; vacuum full verbose ana

How can I use Postgres "ROLLBACK TO SAVEPOINT" with "FOR UPDATE SKIP LOCKED"?

2018-08-25 Thread Andrew Stuart
Postgres 10 I am trying to use "FOR UPDATE SKIP LOCKED" to make a work queue in Postgres. My goal is to be able to set status to 'complete' or 'failed' as the outcome by using "ROLLBACK TO SAVEPOINT;" in the event that processing fails. I expected the code below to result in a final status of "

Re: Linker errors while creating a PostgreSQL C extension function.

2018-08-25 Thread TalGloz
I removed the flag --no-undefined and it was compiled and worked like a charm. I needed the flag to spot the linker errors for linking with the external *libseal.a* library. As for my other question regarding the unused linker path *-L"/usr/local/lib"*. I'm using Fedora 28 (RedHat) and in this dis

Re: unorthodox use of PG for a customer

2018-08-25 Thread Gary M
Hmmm I usually don't participate in forums and accidentally sent my reply to David Gauthier directly. This issue sounds interesting I'll give it another try and send the reply to the group. >From my simple, engineering hat perspective I feel this question is difficult to answer without hard num

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-25 Thread TalGloz
Yes, that was the problem and now everything works. Thanks, Tal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-25 Thread Tom Lane
TalGloz writes: > Datum* elements[2]; Datum, not Datum*. regards, tom lane

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-25 Thread TalGloz
OK so I think I'm on the right way with this code and now my goal is to return a text array (text[ ]) with 2 fields extern "C" { Datum text_array(PG_FUNCTION_ARGS){ // For text aka. character varying parameter text *t1 = PG_GETARG_TEXT_PP(0); text *t2 = PG_GETARG_TEXT_

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-25 Thread Tom Lane
TalGloz writes: > I want to return an vector of pairs using a C extension. You're going to have to work a lot harder than this: > // Return vector of pairs > std::vector> ret; > ret.emplace_back(encodedLocalT1, encodedLocalT2); > PG_RETURN_ARRAYTYPE_P(ret); I do

Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-25 Thread TalGloz
Hello, I want to return an vector of pairs using a C extension. This is a simple code I have: extern "C" { Datum pair(PG_FUNCTION_ARGS){ // For text aka. character varying parameter text *t1 = PG_GETARG_TEXT_PP(0); text *t2 = PG_GETARG_TEXT_PP(1); std::string loca