[GENERAL] consolidating data with window functions

2016-08-01 Thread Andrew Geery
I have a data-set with - a line number - a name - a value I want to select the rows in line number order, but I want to consolidate consecutive rows into a single row, concatenating the names, if the value is null. For example, here's my data: values ( (1, 'a', 1), (2, 'b', 2), (3, 'c', null), (

[GENERAL] gin index operator class functions in sql?

2016-07-21 Thread Andrew Geery
For a custom type to be used in a btree index, it is possible to create a function in SQL (as opposed to C) that is used in the create operator class statement to specify how equality is defined. A good example of this is presented inhttp://www.cybertec.at/2013/11/operator-classes-explained/. Is

[GENERAL] extracting total amount of time from an interval

2010-07-01 Thread Andrew Geery
Is there a way to extract the total amount of time in a given unit from an interval? For example, I would like to know the total number of milliseconds in an interval. The expression select extract('seconds' from '5 minutes'::interval) returns the value of the seconds field (0) in the interval;

Re: [GENERAL] missing uuid functions in postgresql-contrib RPM for linux?

2010-06-23 Thread Andrew Geery
FWIW, I don't see the install script in the RHEL5 version RPM either: # rpm -qpl postgresql-contrib-8.4.4-1PGDG.rhel5.i386.rpm | grep -i uid /usr/share/doc/postgresql-contrib-8.4.4/uninstall_uuid-ossp.sql Thanks Andrew 2010/6/23 Devrim GÜNDÜZ : > On Wed, 2010-06-23 at 09:29 -0400, Andr

[GENERAL] missing uuid functions in postgresql-contrib RPM for linux?

2010-06-23 Thread Andrew Geery
In the postgresql-contrib-8.4.4-1PGDG.rhel4 RPM (downloaded from http://www.postgresql.org/ftp/binary/v8.4.4/linux/rpms/redhat/rhel-4-i386/), there is no installation script or libraries for the uuid_* functions: # rpm -qlp postgresql-contrib-8.4.4-1PGDG.rhel4.i386.rpm | grep -i uid /usr/share/doc

[GENERAL] full-text search configuration question

2010-06-08 Thread Andrew Geery
I have several tables with text columns that contain information that I would like to be able to search using a FTS index. For each text column, there is also a column that is a foreign key into a language table for the language used in the text. My idea is to add a column to the language table t