Re: [SQL] pg_config -less

2010-09-23 Thread Rob Sargent
And while on the topic of uuid (again), building postgres 9 from source seems to transpose the library name: libossp-uuid v. libuuid-ossp. I had to put in a simlink to get configure to agree I had the library (rev 1.6.2 from ossp.org) On 09/23/2010 08:49 AM, Tom Lane wrote: > Rob Sargent writes

Re: [SQL] pg_config -less

2010-09-23 Thread Rob Sargent
Absolutely correct. The dev package was later installed so I got my answer (no real uuid support) but I was wondering if it was possible to get that sort of info from psql directly. On 09/23/2010 08:49 AM, Tom Lane wrote: > Rob Sargent writes: >> A local installation of 9.0 does not seem to incl

[SQL] identifying duplicates in table with redundancies

2010-09-23 Thread Tarlika Elisabeth Schmitz
I loaded data from a spread into a interim table so I can analyze the quality of the data. The table contains an entry for every student (250K records) and his trainer. Eventually, I want to extract a unique list of trainers from it. But first of all I want to check for duplicates: 1) multiples t

Re: [SQL] Question Regarding Unique Index on Table

2010-09-23 Thread Kenneth Marshall
9.0 allows you to defer unique constraints. Ken On Thu, Sep 23, 2010 at 10:18:39AM -0700, Ozer, Pam wrote: > Is it possible to disable a unique index? I have a process that's > running that inserts duplicate records into a table and then does a > cleanup afterwards. I know that I can drop the i

[SQL] Question Regarding Unique Index on Table

2010-09-23 Thread Ozer, Pam
Is it possible to disable a unique index? I have a process that's running that inserts duplicate records into a table and then does a cleanup afterwards. I know that I can drop the index and rebuild. I just didn't know if there was disable the uniqueness temporarily. thanks Pam Ozer Dat

Re: [SQL] Proper case function

2010-09-23 Thread Jonathan Brinkman
Here is a simple title-case function for Postgresql. Best, Jonathan CREATE OR REPLACE FUNCTION "format_titlecase" ( "v_inputstring" varchar ) RETURNS varchar AS $body$ /* select * from Format_TitleCase('MR DOG BREATH'); select * from Format_TitleCase('each word, mcclure of this string:shall be

Re: [SQL] pg_config -less

2010-09-23 Thread Tom Lane
Rob Sargent writes: > A local installation of 9.0 does not seem to include pg_config. (not > with pg_dump pg_ctl etc, no man page) > This is a Suse box (openSUSE 11.2 (x86_64)). Most likely, Suse's packager decided to put it in the postgresql-devel subpackage (or maybe they spell it postgresql-d

[SQL] pg_config -less

2010-09-23 Thread Rob Sargent
A local installation of 9.0 does not seem to include pg_config. (not with pg_dump pg_ctl etc, no man page) This is a Suse box (openSUSE 11.2 (x86_64)). Is it possible to dig around for the info returned from pg_config --configure (especially uuid support)? Thanks. -- Sent via pgsql-sql mailing

Re: [SQL] HowTo divide streetname from house-nr ?

2010-09-23 Thread Andreas Schmitz
The only chance I see is to combine the information about the localization with the address pattern. regards Andreas On 09/23/2010 09:12 AM, negora wrote: I guess that it's impossible to look for a solution which works on every existing case, specially if you're handling addresses from

Re: [SQL] unique fields

2010-09-23 Thread Oliveiros d'Azevedo Cristina
Howdy, Adrian Dunno if this is exactly what you want SELECT * FROM ( SELECT chr,cfrom,cto,count(*) as numberOfDuplicates FROM t_fairly_large_table GROUP BY chr,cfrom,cto ) x NATURAL JOIN t_fairly_large_table y WHERE numberOfDuplicates > 1 The idea of this (untested) query is to produce somet

Re: [SQL] unique fields

2010-09-23 Thread Sergey Konoplev
Hi, On 23 September 2010 07:30, Adrian Johnson wrote: > I want to find out how many duplications are there for chr, cfrom and cto Start with it http://www.postgresql.org/docs/9.0/interactive/tutorial-agg.html p.s. SELECT chr, cfrom, cto, count(*) FROM your_table GROUP BY 1, 2, 3; > > a.   c2,

Re: [SQL] HowTo divide streetname from house-nr ?

2010-09-23 Thread negora
I guess that it's impossible to look for a solution which works on every existing case, specially if you're handling addresses from several countries. However, if you've certain control over the user inputs, maybe you could try replacing certain parts employing some kind of regular _expression_