Re: pg_total_relation_size accuracy guarantee

2017-11-23 Thread Laurenz Albe
Nikita wrote: > 1. pg_total_relation_size return predictable approximately correct table size > (apart from some preallocation) without subsequent VACUUM/ANALYZE/anything > call as long as I don't DELETE/UPDATE rows; > > 2. DROP/TRUNCATE table reclaim disc space without subsequent VACUUM; > >

Re: On Judging the Value of Tests

2017-11-23 Thread Michael Paquier
On Fri, Nov 24, 2017 at 10:27 AM, Jankirk.Vincent., Jamison wrote: > I will take note of all your advice. I think it's because I've noticed that a > lot of functions and lines are still not covered by tests > (https://coverage.postgresql.org/), so I feel like I want to work on tests > first whi

RE: On Judging the Value of Tests

2017-11-23 Thread Jankirk.Vincent., Jamison
1. How do you judge when a test suite is acceptable to be added to Postgres OSS source code? (How do you judge the value of a test suite?) >>> >>> Make your argument for it, and see if others agree. There's no formal >>> process. > > Yeah. Also realize that we've been accreti

Re: update field in jsonb

2017-11-23 Thread support-tiger
Oleg, hey, thanks so much - if you are in USA visiting Yellowstone Natl Park contact me and the beer is on me (maybe a Wyoming steak too!) On 11/22/2017 11:27 PM, Oleg Bartunov wrote: On Thu, Nov 23, 2017 at 4:45 AM, support-tiger wrote: is there a way to update a single field in jsonb wit

pg_total_relation_size accuracy guarantee

2017-11-23 Thread Nikita
Hello, I'am currently trying to implement some simple disc space limitation mechanism for my database. Database is partition based and insert-only - I insert new rows to the current partition and drop oldest partition when disc space limit exceeded. Algorithm is quite simple and it seems it works

Re: Implementation of gtrgm_out for gevel

2017-11-23 Thread Dmitry Lazurkin
On 23.11.2017 21:58, Tom Lane wrote: > Dmitry Lazurkin writes: >> Datum >> gtrgm_out(PG_FUNCTION_ARGS) >> { >>     GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0); /* I think entry >> is pointer to bad memory */ > The argument is TRGM *, I think ... certainly not GISTENTRY *. > >

Re: Implementation of gtrgm_out for gevel

2017-11-23 Thread Tom Lane
Dmitry Lazurkin writes: > I want use gevel (http://www.sai.msu.su/~megera/wiki/Gevel) for investigation > of pg_trgm gist. But for gist_print i need implement gtrgm_out for pg_trgm > gist node. And i have a problem here. > Datum > gtrgm_out(PG_FUNCTION_ARGS) > { >     GISTENTRY  *entry = (GISTE

Implementation of gtrgm_out for gevel

2017-11-23 Thread Dmitry Lazurkin
Hello. I want use gevel (http://www.sai.msu.su/~megera/wiki/Gevel) for investigation of pg_trgm gist. But for gist_print i need implement gtrgm_out for pg_trgm gist node. And i have a problem here. - My version: PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubun

Re: [GENERAL] Date Time data types

2017-11-23 Thread Rakesh Kumar
>What is difference between CLOCK_TIMESTAMP() and CURRENT_TIMESTAMP? CURRENT_TIMESTAMP stays the same within the transaction. It is very useful when you are you inserting to multiple tables and want to use the timestamp columns to chain the rows together. CLOCK_TIMESTAMP is the true timestam

Re: Set role dynamically from proc

2017-11-23 Thread Durumdara
Dear David! To know - your solution is working well! *EXECUTE format('SET ROLE %I', variablename); * Thank you! bw dd

Re: [GENERAL] Multiple key error .

2017-11-23 Thread Geoff Winkless
On 23 November 2017 at 11:37, Szymon Lipiński wrote: > table can have only one primary key. And most probably you already have one. To clarify, you can have multiple UNIQUE constraints on a table, but only one PRIMARY. Geoff

Re: [GENERAL] Multiple key error .

2017-11-23 Thread Szymon Lipiński
On 23 November 2017 at 12:31, Brahmam Eswar wrote: > Unable to add multiple keys to the table. > > ALTER TABLE table1 ADD CONSTRAINT Table1_PK PRIMARY KEY (Col1,Col2); > > ERROR: multiple primary keys for table "table1" are not allowed > SQL state: 42P16 > > -- > Thanks & Regards, > Brahmeswara

[GENERAL] Multiple key error .

2017-11-23 Thread Brahmam Eswar
Unable to add multiple keys to the table. ALTER TABLE table1 ADD CONSTRAINT Table1_PK PRIMARY KEY (Col1,Col2); ERROR: multiple primary keys for table "table1" are not allowed SQL state: 42P16 -- Thanks & Regards, Brahmeswara Rao J.

Re: [GENERAL] Date Time data types

2017-11-23 Thread Murtuza Zabuawala
As per my knowledge, CLOCK_TIMESTAMP value changes every time you call it even in the same transaction BEGIN ... CLOCK_TIMESTAMP() -- Gives 2017-11-23 15:02:27.492867+05:30 ... ... CLOCK_TIMESTAMP() -- Gives different time as per current clock time ... END; CURRENT_TIMESTAMP ​is t

[GENERAL] Date Time data types

2017-11-23 Thread Brahmam Eswar
What is difference between CLOCK_TIMESTAMP() and CURRENT_TIMESTAMP? Is there any specific use case to differentiate them . -- Thanks & Regards, Brahmeswara Rao J.