Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread rob stone
Hello Roberto, On Fri, 2017-02-10 at 10:17 -0500, Roberto Balarezo wrote: > Hi, I would like to know why this is happening and some advice if > there is a way to solve this problem: > > I have a query like this: > > select COALESCE(duedate, ? + 1) from invoices order by duedate desc > limit 10;

[GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Roberto Balarezo
Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this: select COALESCE(duedate, ? + 1) from invoices order by duedate desc limit 10; where ? is a query parameter. I’m using JDBC to connect to the database, and sending

Re: [GENERAL] Alter view with psql command line

2017-02-10 Thread Leonardo M . Ramé
El 10/02/17 a las 14:17, Adrian Klaver escribió: On 02/10/2017 09:09 AM, Leonardo M. Ramé wrote: Hi, is there a way to alter a view using *psql*?, something like what \ef does for functions. In 9.6: That's why in 9.1 I didn't find that command...

[GENERAL] Alter view with psql command line

2017-02-10 Thread Leonardo M . Ramé
Hi, is there a way to alter a view using *psql*?, something like what \ef does for functions. Regards, -- Leonardo M. Ramé Medical IT - Griensu S.A. Av. Colón 636 - Piso 8 Of. A X5000EPT -- Córdoba Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19 Cel.: +54 9 (011) 40871877 --

Re: [GENERAL] Locks Postgres

2017-02-10 Thread Jeff Janes
On Thu, Feb 9, 2017 at 9:00 PM, Patrick B wrote: > Hi guys > > I just wanna understand the locks in a DB server: > [image: Imagem inline 1] > > Access share = Does that mean queries were waiting because an > update/delete/insert was happening? > It would seem more

Re: [GENERAL] Alter view with psql command line

2017-02-10 Thread Adrian Klaver
On 02/10/2017 09:09 AM, Leonardo M. Ramé wrote: Hi, is there a way to alter a view using *psql*?, something like what \ef does for functions. In 9.6: https://www.postgresql.org/docs/9.6/static/app-psql.html \ev [ view_name [ line_number ] ] Regards, -- Adrian Klaver

Re: [GENERAL] Alter view with psql command line

2017-02-10 Thread David Fetter
On Fri, Feb 10, 2017 at 02:26:18PM -0300, Leonardo M. Ramé wrote: > El 10/02/17 a las 14:17, Adrian Klaver escribió: > > On 02/10/2017 09:09 AM, Leonardo M. Ramé wrote: > > > Hi, is there a way to alter a view using *psql*?, something like what > > > \ef does for functions. > > > > In 9.6: > > >

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 01:51 PM, Roberto Balarezo wrote: Hi, The parameter defaultDueDate is a java.sql.Date object, an actual Date. When I run the query with the value in it, it works: ```sql db=> select COALESCE(duedate, date '2017-02-01' + 1) from invoices order by duedate desc; coalesce

Re: [GENERAL] clarification about standby promotion

2017-02-10 Thread Michael Paquier
On Fri, Feb 10, 2017 at 7:15 PM, Jehan-Guillaume de Rorthais wrote: > On Thu, 9 Feb 2017 18:27:30 + > Rakesh Kumar wrote: > >> >Sure, but when you are doing a switchover, the standby is supposed to be >> >connected to the master when you shutdown

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 02:14 PM, Roberto Balarezo wrote: Hmmm... I didn't know PostgreSQL had a facility for query logging and debugging of parameters to a logfile. Thought I had to execute a describe or something like that. Thanks, I'll try it to see what's happening! Start here:

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Arjen Nienhuis
On Feb 10, 2017 8:11 PM, "Roberto Balarezo" wrote: Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this: select COALESCE(duedate, ? + 1) from invoices order by duedate desc limit 10; where ? is a

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 07:17 AM, Roberto Balarezo wrote: Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this: |select COALESCE(duedate, ? + 1) from invoices order by duedate desc limit 10; | What is the 1 in ? + 1 supposed

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 01:33 PM, Arjen Nienhuis wrote: On Feb 10, 2017 8:11 PM, "Roberto Balarezo" > wrote: Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this:

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread David G. Johnston
In short - this is the wrong list (pgsql-j...@postgresql.org is the appropriate one; or the official GitHub repo) and you need to provide some working self-contained examples showing exactly what you are doing.​​ On Fri, Feb 10, 2017 at 8:17 AM, Roberto Balarezo wrote: > Hi,

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread rob stone
Hello Roberto, On Fri, 2017-02-10 at 16:43 -0500, Roberto Balarezo wrote: > Hi Rob, > > Thanks for your answer. The query is just an example I made to > illustrate the problem. In the database I'm working with, duedate is > a timestamp without timezone column, which can contain null values. > The

[GENERAL] BDR problem rejoining node

2017-02-10 Thread Tanner Kerr
I have two databases being replicated across three nodes with bdr. The third node filled up and crashed. I removed this node from the group successfully, but now I'm having trouble rejoining it. I'm able to re-join the one database no problem. However, trying to do a bdr join on the other causes

Re: [GENERAL] PostgreSQL on eMMC - Corrupt file system

2017-02-10 Thread Mark Morgan Lloyd
On 09/02/17 23:00, Christoph Moench-Tegeder wrote: ## Thomas Güttler (guettl...@thomas-guettler.de): Is running linux with postgres on eMMC a bad idea in general? I'd say that running anything with a read-write load on eMMC will end in pieces. It's ok to occasionally write something, but a

Re: [GENERAL] clarification about standby promotion

2017-02-10 Thread Jehan-Guillaume de Rorthais
On Thu, 9 Feb 2017 18:27:30 + Rakesh Kumar wrote: > >Sure, but when you are doing a switchover, the standby is supposed to be > >connected to the master when you shutdown the master. So based on the doc, > >the standby should receive **everything** from the master

Re: [GENERAL] Build exclusion constraints USING INDEX

2017-02-10 Thread Steven Winfield
> I was wondering if there was any way to break down the creation of a new > exclusion constraint into stages such that table locks most likely to affect > performance during production hours are not taken. > > Something like: > > CREATE INDEX CONCURRENTLY new_index ON my_table USING gist

Re: [GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Thomas Kellerer
Peter J. Holzer schrieb am 10.02.2017 um 14:02: > So it's doing a sequential scan on the initial select in the recursive > CTE, but using the index on the subsequent selects. > > But why? If it uses the index on > SELECT MIN(periodizitaet) FROM facttable_imf_ifs WHERE periodizitaet > 'x' >

Re: [GENERAL] clarification about standby promotion

2017-02-10 Thread Rakesh Kumar
>> Kill ? You mean "pg_ctl stop -m fast" right ? Yes. >Use timeline to resync ? Timeline is an internal mechanism in PostgreSQL, not >a tool, so I don't get this step...You mean using pg_rewind ? pg_rewind which uses timeline. -- Sent via pgsql-general mailing list

[GENERAL] [Off Topic] Visualizing grouping sets/cubes

2017-02-10 Thread Leonardo M . Ramé
Hi, I'm reading about Grouping Sets/Rollup/Cube and I wonder which js/html5 library allows displaying *easily* (without having to re-format it) the returned data from those functions. Regards, -- Leonardo M. Ramé Medical IT - Griensu S.A. Av. Colón 636 - Piso 8 Of. A X5000EPT -- Córdoba Tel.:

[GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Peter J. Holzer
I was almost through writing a bug report when I figured out what I was doing wrong, so I'll post it here in the hope that it prevents someone from tearing their hair out. I was trying to use a loose index scan as described on https://wiki.postgresql.org/wiki/Loose_indexscan on a column with just

Re: [GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Peter J. Holzer
On 2017-02-10 14:24:36 +0100, Thomas Kellerer wrote: > Peter J. Holzer schrieb am 10.02.2017 um 14:02: > > So it's doing a sequential scan on the initial select in the recursive > > CTE, but using the index on the subsequent selects. > > > > But why? If it uses the index on > > SELECT