[GENERAL] GSL in mcbc(redhat)

2013-04-12 Thread Yuriy Rusinov
Hello, colleagues ! I have to develop some functions onto postgresql server 9.2 based on Gnu Scientific Library. Under redhat I compile gsl with ./configure --prefix=/usr/local compile postgresql with ./configure --prefix=/usr/local --with-uuid-ossp --with-xml --with-xslt. After that I try to put

[GENERAL] list non alphanumeric

2013-04-12 Thread Baboo, Isa
Hi Firstly let me mention I am a noob to postgres,DB and sql anyway, I have a column with First names and need to list names that have non-alphanumeric characters in them like + or * and the list goes on. I did google a bit and tried: select * from TABLE where first_name not like

Re: [GENERAL] list non alphanumeric

2013-04-12 Thread John R Pierce
On 4/11/2013 11:23 PM, Baboo, Isa wrote: Firstly let me mention I am a noob to postgres,DB and sql anyway, I have a column with First names and need to list names that have non-alphanumeric characters in them like + or * and the list goes on. I did google a bit and tried: /select * from

Re: [GENERAL] list non alphanumeric

2013-04-12 Thread Baboo, Isa
Hi Thanks for the response but I tried that and it does not work here is an example of names which still display. test sadadds Hillary BEN NAME ALAN MCGARVEY + From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: 12 April 2013

Re: [GENERAL] list non alphanumeric

2013-04-12 Thread Ian Lawrence Barwick
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: 12 April 2013 08:41 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] list non alphanumeric On 4/11/2013 11:23 PM, Baboo, Isa wrote: Firstly let me mention I am

Re: [GENERAL] list non alphanumeric

2013-04-12 Thread John R Pierce
On 4/11/2013 11:50 PM, Baboo, Isa wrote: Thanks for the response but I tried that and it does not work here is an example of names which still display. test sadadds Hillary BEN NAME ALAN MCGARVEY + well, at least one of those has a space inline, you didn't say that was acceptable,

Re: [GENERAL] list non alphanumeric

2013-04-12 Thread Baboo, Isa
Hi It still displaying everything, maybe it is the spaces? test sadadds Hillary BEN NAME BOB /+ ...skipping ALAN MCGARVEY + -Original Message- From: Ian Lawrence Barwick [mailto:barw...@gmail.com] Sent: 12 April 2013 09:08 AM To: Baboo, Isa Cc: John R Pierce;

Re: [GENERAL] list non alphanumeric

2013-04-12 Thread Baboo, Isa
Hi Sorry guys I should have mention spaces, I did but it was a bit late. Anyway that [A-Za-z0-9 ] worked thanks John. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: 12 April 2013 09:12 AM To: pgsql-general@postgresql.org

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-12 Thread Condor
On 2013-04-10 22:35, Thomas Kellerer wrote: John R Pierce wrote on 10.04.2013 21:28: On 4/10/2013 6:15 AM, Thomas Kellerer wrote: psql (one of the possible client applications) uses the datestyle parameter to decide on how to format a date column when displaying it. If you change the

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-12 Thread John R Pierce
On 4/12/2013 12:42 AM, Condor wrote: and ISO, DMY show me: 2012-10-15 11:00:49.397908 if I use Postgres, DMY show me Mon 15 Oct 11:00:49.397908 2012 But I want to be formatted: 11:00:49 15-10-2012 use the date formatting functions, like... select to_char(yourfield, 'HH:MI:SS

[GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Yang Zhang
Any hints with this question I had posted to SO? http://stackoverflow.com/questions/15965785/why-is-postgresql-9-1-not-using-index-for-simple-equality-select Pasted here as well. Thanks. My table `lead` has an index: \d lead ... Indexes: lead_pkey PRIMARY KEY, btree (id)

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread John R Pierce
On 4/12/2013 1:03 AM, Yang Zhang wrote: db= explain select * from lead where email = 'blah'; QUERY PLAN Seq Scan on lead (cost=0.00..319599.38 rows=1 width=5108) Filter: (email =

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Yang Zhang
Doesn't seem to be the case. This table has been around for a while and should have been auto-analyzed by now. But anyway: db= analyze lead; ANALYZE db= explain select * from lead where email = 'f...@blah.com'; QUERY PLAN

[GENERAL] Automatic restart while upgrade

2013-04-12 Thread stephane . schildknecht
Hello, I discovered that while upgrading PostgreSQL binaries through 'yum update', with PGDG RPMs, the service is automatically restarted. ISTM that this was not the case before 9.2. May you confirm that this is a new behaviour appearing in 9.2? Is it intended, and is there a way to prevent

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Alban Hertroys
On 12 April 2013 10:45, Yang Zhang yanghates...@gmail.com wrote: explain select * from lead where email = 'f...@blah.com'; What about: explain analyze select * from lead where email = 'f...@blah.com'; -- If you can't see the forest for the trees, Cut the trees and you'll see there is no

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-12 Thread Condor
On 2013-04-12 10:59, John R Pierce wrote: On 4/12/2013 12:42 AM, Condor wrote: and ISO, DMY show me: 2012-10-15 11:00:49.397908 if I use Postgres, DMY show me Mon 15 Oct 11:00:49.397908 2012 But I want to be formatted: 11:00:49 15-10-2012 use the date formatting functions, like...

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-12 Thread Pavel Stehule
2013/4/12 Condor con...@stz-bg.com On 2013-04-12 10:59, John R Pierce wrote: On 4/12/2013 12:42 AM, Condor wrote: and ISO, DMY show me: 2012-10-15 11:00:49.397908 if I use Postgres, DMY show me Mon 15 Oct 11:00:49.397908 2012 But I want to be formatted: 11:00:49 15-10-2012 use the

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread John R Pierce
On 4/12/2013 1:45 AM, Yang Zhang wrote: db= explain select * from lead where email = 'f...@blah.com'; can you try explain analyze select * from lead where email = 'f...@blah.com'; ? -- john r pierce 37N 122W somewhere on the middle of the left coast

Re: [GENERAL] Segmentation fault with core dump

2013-04-12 Thread Andres Freund
On 2013-04-10 19:06:12 -0400, Tom Lane wrote: I wrote: (Wanders away wondering just how much the regression tests exercise holdable cursors.) And the answer is they're not testing this code path at all, because if you do DECLARE c CURSOR WITH HOLD FOR ... FETCH ALL FROM c;

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-12 Thread Adrian Klaver
On 04/12/2013 01:54 AM, Condor wrote: -- john r pierce 37N 122W somewhere on the middle of the left coast Yes, I see this function but if I need to select 100 000 rows this mean I think, this function will be start 100 000 times. I mean when I ask the

Re: [GENERAL] Automatic restart while upgrade

2013-04-12 Thread Tom Lane
stephane.schildkne...@postgres.fr writes: I discovered that while upgrading PostgreSQL binaries through 'yum update', with PGDG RPMs, the service is automatically restarted. ISTM that this was not the case before 9.2. I dunno whether Devrim's packages acted that way before 9.2, but this is

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Tom Lane
Yang Zhang yanghates...@gmail.com writes: db= explain select * from lead where email = 'blah'; QUERY PLAN Seq Scan on lead (cost=0.00..319599.38 rows=1 width=5108) Filter: (email =

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Yang Zhang
It's actually just `text`. I updated my SO question with some more info including explain analyze (no difference), \d, and your last incantation. Thanks! On Fri, Apr 12, 2013 at 7:11 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yang Zhang yanghates...@gmail.com writes: db= explain select * from

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Tom Lane
Yang Zhang yanghates...@gmail.com writes: I updated my SO question with some more info including explain analyze (no difference), \d, and your last incantation. The question is being asked here, not in SO, and I find it rather impolite of you to expect me to go chasing off to some other forum

Re: [GENERAL] Why is PostgreSQL 9.1 not using index for simple equality select

2013-04-12 Thread Yang Zhang
Apologies for that Tom. I will paste the information in line once I'm back at my computer. I do appreciate your help. On Fri, Apr 12, 2013 at 10:24 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yang Zhang yanghates...@gmail.com writes: I updated my SO question with some more info including explain

[GENERAL] False unique constraint violation (exception block)

2013-04-12 Thread whiplash
Hello. This is simple example for describe my problem. I created a table: CREATE TABLE table0 ( id serial NOT NULL, field0 integer, field1 text ); I created an unique index for this table: CREATE UNIQUE INDEX idx_table0_unique ON table0 ( field0, coalesce ( field1,

Re: [GENERAL] Automatic restart while upgrade

2013-04-12 Thread Gavin Flower
On 13/04/13 02:08, Tom Lane wrote: stephane.schildkne...@postgres.fr writes: I discovered that while upgrading PostgreSQL binaries through 'yum update', with PGDG RPMs, the service is automatically restarted. ISTM that this was not the case before 9.2. I dunno whether Devrim's packages acted

[GENERAL] GSL onto postgresql server 9.2

2013-04-12 Thread Yuriy Rusinov
Hello, colleagues ! I have to put some C-language functions onto postgresql server 9.2. These functions are used GSL software library http://www.gnu.org/software/gsl/. In Makefile for these functions I wrote LD_FLAGS = ... -lgsl, On some source-based Linux distributions such as gentoo linux these

Re: [GENERAL] False unique constraint violation (exception block)

2013-04-12 Thread Kevin Grittner
whiplash whipl...@bss.org.ua wrote: sometimes I getting false unique violation How do you know that they are false? What version of PostgreSQL is this? Can you create a small self-contained test case that demonstrates the issue?  (The snippets you provided probably excluded the cause of the

Re: [GENERAL] False unique constraint violation (exception block)

2013-04-12 Thread Jeff Janes
On Fri, Apr 12, 2013 at 8:44 AM, whiplash whipl...@bss.org.ua wrote: CREATE UNIQUE INDEX idx_table0_unique ON table0 ( field0, coalesce ( field1, 'INDEX_COLUMN_NULL' ) ); I created function for insert only unique record (part of code): BEGIN INSERT INTO table0 ( field0, field1 )