Re: Postgres hangs for the query "lock table in exclusive mode"

2018-02-22 Thread David G. Johnston
On Thursday, February 22, 2018, Vinodh NV wrote: > > > Postgres hangs for the query "lock table in exclusive mode" > Can you please let me know what could be the reason and how to resolve it? > > Not readily, but that's why the pg_locks view exists. https://www.postgresql.org/docs/9.6/static/vie

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Paul Jungwirth
On 02/22/2018 04:44 PM, Ken Tanzer wrote: Hi, hoping to get some help with this.  I'm needing to take a specific date, a series of dateranges  and, given a specific date, return a single conitinuous daterange that includes that date. The part about joining multiple touching dateranges to give

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 09:05 PM, Adrian Klaver wrote: On 02/22/2018 05:23 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote:     On 02/22/2018 04:58 PM, Ken Tanzer wrote:     On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver     mai

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 05:23 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/22/2018 04:58 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>

Postgres hangs for the query "lock table in exclusive mode"

2018-02-22 Thread Vinodh NV
Hi, Postgres hangs for the query "lock table in exclusive mode" Can you please let me know what could be the reason and how to resolve it? Regards, Vinodh.

Re: Getting a primitive numeric value from "DatumGetNumeric"?

2018-02-22 Thread Tom Lane
Michael Paquier writes: > On Thu, Feb 22, 2018 at 08:00:45PM -0500, Demitri Muna wrote: >> Out of curiosity, how does one read a numeric type from within a C >> extension (i.e. get a number value out of the Datum type)? > PG_GETARG_NUMERIC(), no? I think the core point here is that PG's "numeric

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-22 Thread David Rowley
On 23 February 2018 at 04:00, Bill Moran wrote: > 2) The negative impact of an unused index is tiny compared to the negative > impact of a missing index. I'd say that would entirely depend on the workload of the table and the entire cluster. Disk space and I/O to write WAL and index pages to is

Re: Performance issues during backup

2018-02-22 Thread PT
On Fri, 23 Feb 2018 01:46:22 + Dylan Luong wrote: > Hi > Thanks for the rely. > I have trialed the ionice -c 2 -n 7 tar…. change to our backup script and it > appears to have helped but not by much. If "ionice -c 2 -n 7" helped some, maybe try "ionice -c 3" to set IO priority to the lowest

Re: Getting a primitive numeric value from "DatumGetNumeric"?

2018-02-22 Thread Michael Paquier
On Thu, Feb 22, 2018 at 08:00:45PM -0500, Demitri Muna wrote: > Ah, I wasn’t aware of implicit coercion. Yes, that solves the problem > perfectly, thanks. > > Out of curiosity, how does one read a numeric type from within a C > extension (i.e. get a number value out of the Datum type)? I ask as I

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 05:23 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/22/2018 04:58 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>

RE: Performance issues during backup

2018-02-22 Thread Dylan Luong
Hi Thanks for the rely. I have trialed the ionice -c 2 -n 7 tar…. change to our backup script and it appears to have helped but not by much. The affected queries are more of the update/delete/insert queries. Could pg_start_backup be causing locking of some sort. Regards Dylan From: Rene Romero B

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Ken Tanzer
On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver wrote: > On 02/22/2018 04:58 PM, Ken Tanzer wrote: > > >> >> On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver > > wrote: >> >> On 02/22/2018 04:44 PM, Ken Tanzer wrote: >> >> Hi, hoping to get some help wit

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 04:58 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/22/2018 04:44 PM, Ken Tanzer wrote: Hi, hoping to get some help with this.  I'm needing to take a specific date, a series of daterange

Re: Getting a primitive numeric value from "DatumGetNumeric"?

2018-02-22 Thread Demitri Muna
Hi Tom, On Feb 20, 2018, at 10:54 PM, Tom Lane wrote: > Well, the implicit coercions work in your favor in this particular case. Ah, I wasn’t aware of implicit coercion. Yes, that solves the problem perfectly, thanks. Out of curiosity, how does one read a numeric type from within a C extensio

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Ken Tanzer
On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver wrote: > On 02/22/2018 04:44 PM, Ken Tanzer wrote: > >> Hi, hoping to get some help with this. I'm needing to take a specific >> date, a series of dateranges and, given a specific date, return a single >> conitinuous daterange that includes that da

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 04:44 PM, Ken Tanzer wrote: Hi, hoping to get some help with this.  I'm needing to take a specific date, a series of dateranges  and, given a specific date, return a single conitinuous daterange that includes that date. To elaborate a bit, I've got lots of tables that include sta

Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Ken Tanzer
Hi, hoping to get some help with this. I'm needing to take a specific date, a series of dateranges and, given a specific date, return a single conitinuous daterange that includes that date. To elaborate a bit, I've got lots of tables that include start and end dates. For example: CREATE TABLE

Re: On error mesage (0x80090325) whilst installing Apps Stack Builder

2018-02-22 Thread Alan Hodgson
> > The problem is that I keep getting the following error mesage: > > - > > --- > > A certificate verification problem was encountered whilst accessing > > https//www.postgresql.org/applications-v2.xml

Re: Understanding query planner cpu usage

2018-02-22 Thread Lucas Fairchild-Madar
On Wed, Feb 21, 2018 at 7:28 PM, Tom Lane wrote: > > > What is the planner doing when trying to find the current live max value > of > > the column? > > It's trying to estimate whether a mergejoin will be able to stop short of > reading all the tuples from the other side of the join. (For instanc

Re: On error mesage (0x80090325) whilst installing Apps Stack Builder

2018-02-22 Thread Steve Atkins
> On Feb 22, 2018, at 10:05 AM, Pablo Liendo wrote: > > Hi, > > Although I'm fairly familiar with IT in general and DBMS in > particular, I'm new to GIS. After reviewing several sources it seems > that a good choice to star t is PostgreSQL. > > I downloaded and installed successfuly the setup,

Re: On error mesage (0x80090325) whilst installing Apps Stack Builder

2018-02-22 Thread Adrian Klaver
On 02/22/2018 10:05 AM, Pablo Liendo wrote: Hi, Although I'm fairly familiar with IT in general and DBMS in particular, I'm new to GIS. After reviewing several sources it seems that a good choice to star t is PostgreSQL. I downloaded and installed successfuly the setup, on a PC desktop runn

On error mesage (0x80090325) whilst installing Apps Stack Builder

2018-02-22 Thread Pablo Liendo
Hi, Although I'm fairly familiar with IT in general and DBMS in particular, I'm new to GIS. After reviewing several sources it seems that a good choice to star t is PostgreSQL. I downloaded and installed successfuly the setup, on a PC desktop running Windows Seven Home Premium. Then came Stack

Re: Any reason not to show "null input" (strict) column in \df+ output?

2018-02-22 Thread Tom Lane
"David G. Johnston" writes: > The STRICT-ness of a function seems like it should be viewable when using > \df+; is its absence just an oversight? I've been annoyed by that in the past. I have some vague memory of proposing adding it and being shot down, on don't-remember-what grounds. But I coul

Any reason not to show "null input" (strict) column in \df+ output?

2018-02-22 Thread David G. Johnston
The STRICT-ness of a function seems like it should be viewable when using \df+; is its absence just an oversight? David J.

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-22 Thread Bill Moran
On Thu, 22 Feb 2018 03:57:34 +0100 Tomas Vondra wrote: > > On 02/21/2018 05:00 PM, Bill Moran wrote: > > On Wed, 21 Feb 2018 13:33:18 +0100 > > Alexander Farber wrote: > > > >> Hi Martin - > >> > >> On Wed, Feb 21, 2018 at 1:26 PM, Martin Moore > >> wrote: > >> > >>> I’m no expert but I’d thin

Re: initdb when data/ folder has mount points

2018-02-22 Thread Ron Johnson
On 02/22/2018 07:22 AM, David Steele wrote: On 2/22/18 1:16 AM, Michael Paquier wrote: On Wed, Feb 21, 2018 at 07:56:38PM -0500, David Steele wrote: On 2/21/18 7:01 PM, Tom Lane wrote: For pg_log, just put it somewhere else and set the appropriate configuration option to say where to write the

Re: initdb when data/ folder has mount points

2018-02-22 Thread David Steele
On 2/22/18 1:16 AM, Michael Paquier wrote: > On Wed, Feb 21, 2018 at 07:56:38PM -0500, David Steele wrote: >> On 2/21/18 7:01 PM, Tom Lane wrote: >>> For pg_log, just put it somewhere else and set the appropriate >>> configuration option to say where to write the postmaster log files. >>> Or you co

Re: Building PostgreSQL old version from source to test vulnerability CVE-2017-7546

2018-02-22 Thread Julián Jiménez González
Thanks for your answer Christoph. I've tried to do that but I can't debug it inside GDB. I configured like so: CFLAGS="-O0 -g" ./configure --enable-debug As I found suggested in a SO thread. Then made and installed, and when I launch gdb either like gdb --args /usr/local/pgsql/bin/postgres -D /u

Re: Building PostgreSQL old version from source to test vulnerability CVE-2017-7546

2018-02-22 Thread Christoph Berg
Re: Julián Jiménez González 2018-02-21 > I need and would greatly appreciate any help tracking this problem down. I'd try setting gdb breakpoints on the relevant code lines/functions. If it helps, old Ubuntu packages are available there: http://atalia.postgresql.org/morgue/ https://wiki.postgre

Re: Selecting the most recent timestamptz

2018-02-22 Thread Alexander Farber
Hi Ken - On Thu, Feb 22, 2018 at 10:24 AM, Ken Tanzer wrote: > On Thu, Feb 22, 2018 at 1:09 AM, Alexander Farber < > alexander.far...@gmail.com> wrote: > >> Good morning, there are these 2 records in a table: >> >> # select m.played, m.mid, m.action, m.gid, m.uid from words_moves m where >> gid=

Re: Selecting the most recent timestamptz

2018-02-22 Thread Ken Tanzer
On Thu, Feb 22, 2018 at 1:09 AM, Alexander Farber < alexander.far...@gmail.com> wrote: > Good morning, there are these 2 records in a table: > > # select m.played, m.mid, m.action, m.gid, m.uid from words_moves m where > gid=10; > played | mid | action | gid | uid > ---

Re: Selecting the most recent timestamptz

2018-02-22 Thread Alexander Farber
Ahh, thank you Laurenz - On Thu, Feb 22, 2018 at 10:18 AM, Laurenz Albe wrote: > > You are only checking if there is a later timestamp *for the same "mid"*. > > Since the two rows have different "mid", they are not compared. > no it works - # select m.played, m.mid, m.action, m.gid, m.uid from

Re: Selecting the most recent timestamptz

2018-02-22 Thread Alexander Farber
s/no it works/now it works/

Re: Selecting the most recent timestamptz

2018-02-22 Thread Laurenz Albe
Alexander Farber wrote: > Good morning, there are these 2 records in a table: > > # select m.played, m.mid, m.action, m.gid, m.uid from words_moves m where > gid=10; > played | mid | action | gid | uid > ---+-++-+- > 2018-02

Selecting the most recent timestamptz

2018-02-22 Thread Alexander Farber
Good morning, there are these 2 records in a table: # select m.played, m.mid, m.action, m.gid, m.uid from words_moves m where gid=10; played | mid | action | gid | uid ---+-++-+- 2018-02-19 14:42:08.46222+01 | 12 | play |

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-22 Thread Alexander Farber
Thank your for the comments