[GENERAL] sign function with INTERVAL?

2016-04-13 Thread Daniel Lenski
Hi all, Is there a good reason why the SIGN() function does not work with the INTERVAL type? (It is only defined for numeric types.) (http://www.postgresql.org/docs/9.5/static/functions-math.html) select sign(-3); -- okay select sign(interval '4 years'); -- ERROR: function sign(interval) does not

Re: [GENERAL] [HACKERS] sign function with INTERVAL?

2016-04-13 Thread Daniel Lenski
On Wed, Apr 13, 2016 at 12:35 PM, Tom Lane wrote: > Jim Nasby writes: >> Actually, after looking at the code for interval_lt, all that needs to >> happen to add this support is to expose interval_cmp_internal() as a >> strict function. It already does exactly what you want. > > interval_cmp() is

Re: [GENERAL] Where art thou, plpython2.dll? (EDB installer)

2014-09-23 Thread Daniel Lenski
Craig Ringer 2ndquadrant.com> writes: > I've had some issues with how the procedural languages are packaged in > the Windows installer for a while, but I was very surprised to see that > plpython2 appears to be entirely absent in 9.3. > > It doesn't seem to be provided via EDB's StackBuilder app

Re: [GENERAL] Where art thou, plpython2.dll? (EDB installer)

2014-09-23 Thread Daniel Lenski
On Tue, Sep 23, 2014 at 11:05 AM, Nick Guenther wrote: > I've struggled with plpython on OpenBSD 5.5-amd64 as well. Could it be related? Maybe the amount of dependencies python pulls in gets overwhelming and things break? > > > $ psql -h localhost -d postgres > psql (9.3.2) > Type "help" for help.

[GENERAL] Why can't I select un-grouped columns when grouping by a (non-primary) unique key?

2014-09-24 Thread Daniel Lenski
If I include the primary key of a table in my GROUP BY clause, PG 9.3 allows me to refer to other columns of that table without explicit GROUP BY: CREATE TABLE A (id SERIAL PRIMARY KEY, name TEXT UNIQUE NOT NULL, document JSON); -- this works fine SELECT A.document FROM A GROU

Re: [GENERAL] Why can't I select un-grouped columns when grouping by a (non-primary) unique key?

2014-09-24 Thread Daniel Lenski
On Wed, Sep 24, 2014 at 10:46 AM, Geoff Montee wrote: > > I believe this blog post contains better examples of the feature he's > referring to: > > http://www.depesz.com/2010/08/08/waiting-for-9-1-recognize-functional-dependency-on-primary-keys/ > > For example: > > SELECT > p.id, > p.firs

Re: [GENERAL] Why can't I select un-grouped columns when grouping by a (non-primary) unique key?

2014-09-24 Thread Daniel Lenski
On Wed, Sep 24, 2014 at 10:37 AM, Alberto Cabello Sánchez wrote: > At first sight, primary key means no grouping at all, as there are no > duplicated A.primary_key values: > > SELECT A.document > FROM A > GROUP BY A.primary_key > > is the same as > > SELECT A.document > FROM A > Y