Re: [GENERAL] Expected behaviour of \d in regexp with exponent numbers ?

2014-09-02 Thread Arnaud Lesauvage
Le 1/09/2014 18:11, Tom Lane a écrit : Arnaud Lesauvage writes: Le 1/09/2014 17:39, Tom Lane a écrit : Not necessarily. \d will match any character that iswdigit() returns true for. It looks like your new server is using a locale that considers "²" to be a digit. Since both PostgreSQL ser

Re: [GENERAL] copymanager question

2014-09-02 Thread David G Johnston
swaroop wrote > one more - i also need to insert useragent strings which have all sorts of > characters in them eg > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, > like Gecko) Chrome/0.2.149.29 Safari/525.13 > > Here there is a comma which causes the copy to fail. Oth

Re: [GENERAL] Expected behaviour of \d in regexp with exponent numbers ?

2014-09-02 Thread Vick Khera
On Mon, Sep 1, 2014 at 12:11 PM, Tom Lane wrote: > I wonder whether this was a bad idea. I think it's unsurprising for the > definition of "alphanumeric" to depend on locale, but I bet most people > are not expecting \d to vary that way. FWIW, tha Perl man page on unicode (perldoc perlunicode) s

Re: [GENERAL] Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions

2014-09-02 Thread Adrian Klaver
On 08/31/2014 09:22 PM, Vinayak wrote: Thank you for reply. The time return by SYSDATE depends on the OS timezone setting while in PostgreSQL we can set the timezone using 'set time zone..' statement so here timezone setting depends on DBMS but I think there are not so many systems that use diff

Re: [GENERAL] alter column to varchar without view drop/re-creation

2014-09-02 Thread Emi Lu
Hello Adrian, test=# UPDATE pg_attribute SET atttypmod = -1 WHERE attrelid = 'base_tbl'::regclass AND attname = 'vc_fld'; test=# UPDATE pg_attribute SET atttypmod = -1 WHERE attrelid = 'v_test'::regclass AND attname = 'vc_fld'; *This is exactly what I plan to do*. So, according to the test

Re: [GENERAL] copymanager question

2014-09-02 Thread swaroop
one more - i also need to insert useragent strings which have all sorts of characters in them eg Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13 Here there is a comma which causes the copy to fail. Other words do not have comma

Re: [GENERAL] copymanager question

2014-09-02 Thread swaroop
Thanks for getting back. So just to confirm if a string value , we need to take care off it ourselves by escaping any special character and quote (single, double) ? I am not exactly sure off the escaping part for each of the characters - have read that for single quotes, we need to add one more

Re: [GENERAL] copymanager question

2014-09-02 Thread Adrian Klaver
On 09/02/2014 01:28 AM, swaroop wrote: Thanks for getting back. So just to confirm if a string value , we need to take care off it ourselves by escaping any special character and quote (single, double) ? I am not exactly sure off the escaping part for each of the characters - have read that for

Re: [GENERAL] copymanager question

2014-09-02 Thread Adrian Klaver
On 09/02/2014 03:20 AM, swaroop wrote: one more - i also need to insert useragent strings which have all sorts of characters in them eg Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13 Here there is a comma which causes the co

[GENERAL] Question about gin index not used on a tsv column

2014-09-02 Thread Patrick Dung
Hello Postgresql users, In my setting, I found that sometimes the query does not use the gin index built for a tsv column. Attached file provide more info (with explain analyze). Thanks and regards, Patrick jobs=> explain analyze SELECT company,industry FROM jobs WHERE tsv @@ to_tsquery('engli

Re: [GENERAL] Question about gin index not used on a tsv column

2014-09-02 Thread David G Johnston
Patrick Dung-2 wrote > Hello Postgresql users, > > In my setting, I found that sometimes the query does not use the gin index > built for a tsv column. > > Attached file provide more info (with explain analyze). So the difference between the first and third queries shown is the fact that the dat

[GENERAL] puzzled by "commit" Logging statement duration

2014-09-02 Thread Day, David
Hoping for a teachable moment :+) With options enabled to log statement execution times in the postgres log file I observe: 2014-09-02T12:47:38.107808-04:00 alabama local0 info postgres[37874]: [702-1] user=ace_db_client,db=ace_db LOG: duration: 0.040 ms statement: BEGIN 2014-09-02T12:47:38

Re: [GENERAL] puzzled by "commit" Logging statement duration

2014-09-02 Thread David G Johnston
Day, David wrote > Hoping for a teachable moment :+) 2-3 of them apparently... > Why is the commit duration so large in [704-1] and the work was done ? in > [703-1] greatly simplified but: COMMIT means - "write to disk"; this is expensive. In a transaction (see below) the statements can b

Re: [GENERAL] adding a nullable column of type domain w/ check constraint runs checks?

2014-09-02 Thread Joe Van Dyk
On Tue, Aug 19, 2014 at 3:20 PM, Joe Van Dyk wrote: > On Tue, Aug 19, 2014 at 3:16 PM, Joe Van Dyk wrote: > >> On Tue, Aug 19, 2014 at 3:10 PM, Joe Van Dyk wrote: >> >>> I have a large table that I don't want to lock for more than couple >>> seconds. I want to add a nullable column to the table

Re: [GENERAL] Question about gin index not used on a tsv column

2014-09-02 Thread Patrick Dung
Thanks for reply, David. I have searched internet and changed one parameter cpu_tuple_cost from 0.01 to 0.08. I would see if it helped. I found the problem occurred randomly. For tsv, I thought if there is an index already built, postgresql should try to make use of it because I think for most

[GENERAL] jsonb and comparison operators

2014-09-02 Thread Joe Van Dyk
Is it possible to get this query (or a similar one) to use an index? I want to return all rows that have a value of less than 10. I have arbitrary keys I want to check (not just 'a'). drop table if exists test; create table test (j jsonb); insert into test select json_build_object('a', i)::json

Re: [GENERAL] jsonb and comparison operators

2014-09-02 Thread Peter Geoghegan
On Tue, Sep 2, 2014 at 9:38 PM, Joe Van Dyk wrote: > I want to return all rows that have a value of less than 10. I have > arbitrary keys I want to check (not just 'a'). If you created an expression B-Tree index on 'a' it would work for 'a', but you'd have to use a jsonb literal, not a json/int4

Re: [GENERAL] jsonb and comparison operators

2014-09-02 Thread Joe Van Dyk
On Tue, Sep 2, 2014 at 9:55 PM, Peter Geoghegan wrote: > On Tue, Sep 2, 2014 at 9:38 PM, Joe Van Dyk wrote: > > I want to return all rows that have a value of less than 10. I have > > arbitrary keys I want to check (not just 'a'). > > > If you created an expression B-Tree index on 'a' it would w