Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Albe Laurenz
Daniel Farina wrote: On Mon, Mar 4, 2013 at 2:27 PM, Maciek Sakrejda m.sakre...@gmail.com wrote: On Sun, Mar 3, 2013 at 9:14 PM, Tom Lane t...@sss.pgh.pa.us wrote: The real difficulty is that there may be more than one storable value that corresponds to 1.23456 to six decimal digits. To be

Re: [GENERAL] 9.2 timestamp function syntax error

2013-03-05 Thread Albe Laurenz
Guy Rouillier wrote: I don't understand the error resulting from the following progression on 9.2 (specifically EnterpriseDB 9.2.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52), 64-bit): select sysdate = timestamp without time zone select

[GENERAL] Finding matching words in a word game

2013-03-05 Thread Alexander Farber
Hello, is there maybe a clever way of finding all possible words from a given set of letters by means of PostgreSQL (i.e. inside the database vs. scanning all database rows by a PHP script, which would take too long) - if the dictionary is kept in a simple table like: create table good_words (

Re: [GENERAL] Finding matching words in a word game

2013-03-05 Thread Alexander Farber
Or I could add integer columns 'a', 'b', ... ,'z' to the table On Tue, Mar 5, 2013 at 10:29 AM, Alexander Farber alexander.far...@gmail.com wrote: create table good_words ( word varchar(16) primary key, stamp timestamp default current_timestamp );

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Kevin Grittner
Daniel Farina dan...@heroku.com wrote: This kind of change may have many practical problems that may make it un-pragmatic to alter at this time (considering the workaround is to set the extra float digits), but I can't quite grasp the rationale for well, the only program that cares about the

Re: [GENERAL] 9.2 timestamp function syntax error

2013-03-05 Thread Adrian Klaver
On 03/05/2013 12:30 AM, Albe Laurenz wrote: Guy Rouillier wrote: I don't understand the error resulting from the following progression on 9.2 (specifically EnterpriseDB 9.2.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52), 64-bit): select sysdate =

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Heikki Linnakangas
On 05.03.2013 15:59, Kevin Grittner wrote: Daniel Farinadan...@heroku.com wrote: This kind of change may have many practical problems that may make it un-pragmatic to alter at this time (considering the workaround is to set the extra float digits), but I can't quite grasp the rationale for

[GENERAL] Why does slony use a cursor? Anyone know?

2013-03-05 Thread Shaun Thomas
Hey everyone, Frankly, I'm shocked at what I just found. We did a delete last night of a few million rows, and come back this morning to find that slony is 9-hours behind. After some investigation, it became apparent that slony opens up a cursor and orders it by the log_actionseq column.

Re: [GENERAL] 9.2 timestamp function syntax error

2013-03-05 Thread Tom Lane
Adrian Klaver adrian.kla...@gmail.com writes: This does not work: test= select timestamp(now()::timestampz); ERROR: syntax error at or near now timestamp(something) is a type name. Per the comment in gram.y: * The type names appearing here are not usable as function names * because they

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Maciek Sakrejda
On Tue, Mar 5, 2013 at 12:03 AM, Albe Laurenz laurenz.a...@wien.gv.at wrote: I don't think that it is about looking nice. C doesn't promise you more than FLT_DIG or DBL_DIG digits of precision, so PostgreSQL cannot either. If you allow more, that would mean that if you store the same number

Re: [GENERAL] 9.2 timestamp function syntax error

2013-03-05 Thread Guy Rouillier
On 3/5/2013 9:52 AM, Tom Lane wrote: Adrian Klaver adrian.kla...@gmail.com writes: This does not work: test= select timestamp(now()::timestampz); ERROR: syntax error at or near now timestamp(something) is a type name. Per the comment in gram.y: * The type names appearing here are not

Re: [GENERAL] Finding matching words in a word game

2013-03-05 Thread Jeff Janes
On Tue, Mar 5, 2013 at 1:29 AM, Alexander Farber alexander.far...@gmail.com wrote: Hello, is there maybe a clever way of finding all possible words from a given set of letters by means of PostgreSQL (i.e. inside the database vs. scanning all database rows by a PHP script, which would take

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread James Cloos
HL == Heikki Linnakangas hlinnakan...@vmware.com writes: HL It would be nice to have a base-2 text format to represent floats. HL It wouldn't be as human-friendly as base-10, but it could be used HL when you don't want to lose precision. pg_dump in particular. hexidecimal notation for floats

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Tom Lane
Maciek Sakrejda m.sakre...@gmail.com writes: Thank you: I think this is what I was missing, and what wasn't clear from the proposed doc patch. But then how can pg_dump assume that it's always safe to set extra_float_digits = 3? It's been proven (don't have a link handy, but the paper is at

Re: [GENERAL] 9.2 timestamp function syntax error

2013-03-05 Thread Tom Lane
Guy Rouillier guy.rouill...@gmail.com writes: Ugh, I just noticed the quotation marks around the timestamp function. This works: select timestamp(now()::timestamptz); = timestamp without time zone This is a subtlety bound to be lost on most. Why is there both a function and a type name

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Maciek Sakrejda
On Tue, Mar 5, 2013 at 10:23 AM, Tom Lane t...@sss.pgh.pa.us wrote: Why the discrepancy between default behavior and what pg_dump gets? Basically, the default behavior is tuned to the expectations of people who think that what they put in is what they should get back, ie we don't want the

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Tom Lane
Maciek Sakrejda m.sakre...@gmail.com writes: On Tue, Mar 5, 2013 at 10:23 AM, Tom Lane t...@sss.pgh.pa.us wrote: Basically, the default behavior is tuned to the expectations of people who think that what they put in is what they should get back, ie we don't want the system doing this by

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Tom Duffey
This conversation has moved beyond my ability to be useful but I want to remind everyone of my original issues in case it helps you improve the docs: 1) Data shown in psql did not match data retrieved by JDBC. I had to debug pretty deep into the JDBC code to confirm that a value I was staring

Re: [HACKERS] [GENERAL] Floating point error

2013-03-05 Thread Edson Richter
Em 05/03/2013 16:01, Tom Duffey escreveu: This conversation has moved beyond my ability to be useful but I want to remind everyone of my original issues in case it helps you improve the docs: 1) Data shown in psql did not match data retrieved by JDBC. I had to debug pretty deep into the JDBC

[GENERAL] How to get array of unique array values across rows?

2013-03-05 Thread Ken Tanzer
I have a field containing a set of codes in a varchar array, each tied to a person. client_id | integer | service_codes | character varying(10)[] | I'm trying to query this info so that I can get the list (presumably in an

Re: [GENERAL] How to get array of unique array values across rows?

2013-03-05 Thread Ken Tanzer
That worked perfectly. Thanks a lot! On Tue, Mar 5, 2013 at 12:49 PM, ChoonSoo Park luisp...@gmail.com wrote: Try this one. select X.client_id, array_agg(X.color) from (select distinct client_id, unnest(service_codes) as color from foo) X group by X.client_id; On

[GENERAL] Postresql database library for Dart programming language

2013-03-05 Thread Greg Lowe
Hi all, I've been working on a Dart library for querying postgresql. If you're curious, have a go and let me know how it goes. https://github.com/xxgreg/postgresql Support for Heroku is coming soon. Cheers, Greg.

[GENERAL] PostgreSQL connect with Visual C++

2013-03-05 Thread dhaval257
Hello friends, I am new to postgres. I am doing Project on Image processing in OpenCV(IDE i am using is Visual C++ 2010). I have downloaded PostgreSQL 8.4 and installed it successfully. I want to know how to connect postgres with visual C++. Please do reply if you know anything. Because I have

[GENERAL]

2013-03-05 Thread News Subsystem
Mon, 04 Mar 2013 19:15:32 -0800 (PST) 04 Mar 2013 19:15:32 -0800 (PST) X-Newsgroups: pgsql.general Date: Mon, 4 Mar 2013 19:15:31 -0800 (PST) Complaints-To: groups-ab...@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.87.68.198;

Re: [GENERAL] Why does slony use a cursor? Anyone know?

2013-03-05 Thread Martijn van Oosterhout
On Tue, Mar 05, 2013 at 08:51:11AM -0600, Shaun Thomas wrote: Hey everyone, Frankly, I'm shocked at what I just found. We did a delete last night of a few million rows, and come back this morning to find that slony is 9-hours behind. After some investigation, it became apparent that slony

Re: [GENERAL] PostgreSQL connect with Visual C++

2013-03-05 Thread Guy Rouillier
On 3/4/2013 11:17 PM, dhaval257 wrote: Hello friends, I am new to postgres. I am doing Project on Image processing in OpenCV(IDE i am using is Visual C++ 2010). I have downloaded PostgreSQL 8.4 and installed it successfully. I want to know how to connect postgres with visual C++. You don't