Re: [GENERAL] converting from bytea to integers

2009-04-20 Thread John DeSoi
On Apr 20, 2009, at 5:23 PM, Daniel Verite wrote: get_byte()? mailtest=> \set e '\'\12\15\107\20\'::bytea' mailtest=> select get_byte(:e,0),get_byte(:e,1),get_byte(:e, 2),get_byte(:e,3); get_byte | get_byte | get_byte | get_byte --+-- +--+-- 10 |

Re: [GENERAL] Doubt about join clause

2009-04-20 Thread Sam Mason
On Mon, Apr 20, 2009 at 08:02:49PM -0400, David Wilson wrote: > On Mon, Apr 20, 2009 at 7:39 PM, jc_mich wrote: > > You've understood very well my problem, but also this query works as worse > > than everything I did before, it throws as many rows as rows are contained > > my tables clients and st

Re: [GENERAL] round behavior differs between 8.1.5 and 8.3.7

2009-04-20 Thread Adrian Klaver
On Monday 20 April 2009 5:20:47 pm Adrian Klaver wrote: > On Monday 20 April 2009 2:21:31 pm Robert Morton wrote: > > Howdy, > > None of the discussions about rounding so far have addressed what appears > > to be a significant change that occurred at some point between PostgreSQL > > v8.1.5 and v8.

Re: [GENERAL] round behavior differs between 8.1.5 and 8.3.7

2009-04-20 Thread Adrian Klaver
On Monday 20 April 2009 2:21:31 pm Robert Morton wrote: > Howdy, > None of the discussions about rounding so far have addressed what appears > to be a significant change that occurred at some point between PostgreSQL > v8.1.5 and v8.3.7. Can someone explain to me the difference between the > two r

Re: [GENERAL] Doubt about join clause

2009-04-20 Thread David Wilson
On Mon, Apr 20, 2009 at 7:39 PM, jc_mich wrote: > > You've understood very well my problem, but also this query works as worse > than everything I did before, it throws as many rows as rows are contained > my tables clients and stores. I only want to find for every client what > store is closer to

Re: [GENERAL] Doubt about join clause

2009-04-20 Thread jc_mich
You've understood very well my problem, but also this query works as worse than everything I did before, it throws as many rows as rows are contained my tables clients and stores. I only want to find for every client what store is closer to him, I expect one client to one store and their distance

Re: [GENERAL] update one table with another

2009-04-20 Thread Alban Hertroys
On Apr 20, 2009, at 10:34 PM, Matthew Pugsley wrote: I've solved it. I just used a subselect. Worked very quickly. I had a lot of trouble with subqueries when I first started databases with MySQL. So I have been afraid of them. update entities set customer_status = select(customer_status

Re: [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?

2009-04-20 Thread Merlin Moncure
On Sun, Apr 19, 2009 at 5:03 PM, Robson Fidalgo wrote: > Until here is everything ok, but I have not success with insert values, then > I tried: > > 1)insert into person values ('Joe', '{("1",""),("2","") }'); > 2)insert into person values ('Joe', array[('1',''),('2','')]); > 3)ins

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread Joshua Tolley
On Mon, Apr 20, 2009 at 02:14:00PM +0200, Stefano Nichele wrote: > Do you think that it could useful mounting two different EBS to handle > data and pg_xlog ? Testing I've participated in suggests that it helps to split pg_xlog elsewhere. Your mileage may vary. - Josh / eggyknap signature.asc

[GENERAL] round behavior differs between 8.1.5 and 8.3.7

2009-04-20 Thread Robert Morton
Howdy, None of the discussions about rounding so far have addressed what appears to be a significant change that occurred at some point between PostgreSQL v8.1.5 and v8.3.7. Can someone explain to me the difference between the two resultsets below? Additionally I would like to understand what opt

Re: [GENERAL] converting from bytea to integers

2009-04-20 Thread Daniel Verite
John DeSoi wrote: I'd like to convert some bytea data to an array of four byte integers (and vice versa). I'm probably missing something obvious, but I don't see an efficient way to generate a 4 byte integer from a bytea string (could be big endian or little endian). get_byte(

[GENERAL] trouble with to_char('L')

2009-04-20 Thread Mikko
Hi, my database has UTF8 encoding and Finnish locale, the client_encoding and the console is set to WIN1252. I created a table with a single NUMERIC(5,2) column and inserted a few values. Running a query 'SELECT to_char(money, '999D99L') FROM table' through psql gives the following error message:

[GENERAL] update one table with another

2009-04-20 Thread Matthew Pugsley
I've solved it. I just used a subselect. Worked very quickly. I had a lot of trouble with subqueries when I first started databases with MySQL. So I have been afraid of them. update entities set customer_status = select(customer_status from entity_dimension_update where entities.entity_id = entit

Re: [GENERAL] Doubt about join clause

2009-04-20 Thread Bill Moran
In response to jc_mich : > > Hello > > I have a table with clients and other with stores, I want to calculate > minimum distances between stores and clients, the client name and its closer > store. > > At this moment I can only get clients ids and minimum distances grouping by > client id, but w

[GENERAL] update one table with another

2009-04-20 Thread Matthew Pugsley
Hello, I am looking for a way to update one table with another. I tried the following schema to update table2 based on data in table1. The idea is that I have a slowly changing dimension and I need to update data in the dimension based on an updated version of the table. I don't want to have to dr

[GENERAL] Re-Install data folder failure

2009-04-20 Thread ray
I have been having troubles getting 8.3 running on Windows XP. My last couple of attempts have been to install 8.3 in a folder off the root rather than off of 'Program Files'. Since I ‘uninstalled’ it, I have not been able to get a good installation. I have tried many times. I use Control Panel

[GENERAL] Doubt about join queries

2009-04-20 Thread jc_mich
Hello I have a table with clients and other with stores, I want to calculate minimum distances between stores and clients, the client name and its closer store. At this moment I can only get clients ids and minimum distances grouping by client id, but when I try to join their respective store id

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread Stefano Nichele
I'll run a java webapp running in tomcat connected to postgres via jdbc. BTW, why the access method should be important ? I mean, my main question is should pg_xlog be located on a different EBS than data ? My doubt is really about logical vs physical disk, since i think EBS is logical a

Re: [GENERAL] New 8.4 features

2009-04-20 Thread Jeff Davis
On Mon, 2009-04-20 at 16:17 +0100, Grzegorz Jaśkiewicz wrote: > There's quite few articles about it on depesz.com. And since I started > to blog recently about my own skirmishes/encounters with postgresql > too - I'll probably write something about it. > So far, personally - I used WITH() for PI ca

Re: [GENERAL] New 8.4 features

2009-04-20 Thread Alvaro Herrera
Greg Smith wrote: > I've been collecting 8.4 related blog and talk presentations onto a list > at http://wiki.postgresql.org/wiki/Waiting_for_8.4 and encourage others > to expand on that with ones I've missed. http://lwn.net/SubscriberLink/328591/3fdb051da4bfee26/ -- Alvaro Herrera

Re: [GENERAL] New 8.4 features

2009-04-20 Thread Greg Smith
On Mon, 20 Apr 2009, Oliver Kohll - Mailing Lists wrote: My question is, is anyone planning to blog / write focussing on these features? There's been regular blog posting from Hubert Lubaczewski in particular covering 8.4 features for over a year now. http://www.planetpostgresql.org/ is a go

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread John R Pierce
Bob Pawley wrote: From your experience could it be used in similar fashion as a website -> running a Postgresql database and having users access the database through an interface? If so, would the users need a Java environment installed on their machines ... um, the users would need a Java

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread Bob Pawley
Hi Stefano I'm intrigued with Amazon EC2 and did a little search on it. From your experience could it be used in similar fashion as a website -> running a Postgresql database and having users access the database through an interface? If so, would the users need a Java environment installed o

Re: [GENERAL] Space for pg_dump

2009-04-20 Thread Jan Otto
On Apr 20, 2009, at 7:35 PM, Alvaro Herrera wrote: Jan Otto wrote: If you have big toast tables you get wrong results with the query suggested at http://wiki.postgresql.org/wiki/Disk_Usage because it takes the toasted values not into account. Now a fixed query which gets the sizes of the re

Re: [GENERAL] Space for pg_dump

2009-04-20 Thread Alvaro Herrera
Jan Otto wrote: > If you have big toast tables you get wrong results with the query > suggested > at http://wiki.postgresql.org/wiki/Disk_Usage because it takes the > toasted > values not into account. > Now a fixed query which gets the sizes of the related pg_toast_oid and > pg_toast_oid_

Re: [GENERAL] Space for pg_dump

2009-04-20 Thread Jan Otto
Hi, Rainer Bauer writes: Greg Smith wrote: Since running an entire pgdump can take forever on a big database, what I usually do here is start by running the disk usage query at http://wiki.postgresql.org/wiki/Disk_Usage Interesting. However, the query gives an error if the table name co

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread Ben Chobot
From the (very little) work I've done with EC2, it seems that what you get logically doesn't have much relation to what you get physically. I don't recall any guarentee that a virtual disk is equivilent to a physical spindle in terms of determining performance, or even that your virtual disk wi

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread Stefano Nichele
Hi, I wanted to reply to an existing thread but it seems a new one has been created, so I think more details are required... I want to run my postgres DB on Amazon EC2 using a EBS persistent disk for postgres installation. In this way data and pg_xlog will be on the same disk. I was just wond

Re: [GENERAL] Problem with pgpool-II tool

2009-04-20 Thread Henry
Quoting "aravind chandu" : I have encountered a problem while configuring pgpool-II,I encountered a problem while executing the following command. You really need to post this on the pgpool list, not here. Subscribe here: http://pgfoundry.org/mailman/listinfo/pgpool-general H

Re: [GENERAL] Set search_path for session

2009-04-20 Thread Mary Sipple
Thanks everyone! A follow up question: Is there any way to set the search_path to all existing schemas? I'm looking for some kind of wild card method that will automatically pick up every schema. Thanks, Mary -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] New 8.4 features

2009-04-20 Thread Grzegorz Jaśkiewicz
There's quite few articles about it on depesz.com. And since I started to blog recently about my own skirmishes/encounters with postgresql too - I'll probably write something about it. So far, personally - I used WITH() for PI calculations, as an example. -- Sent via pgsql-general mailing list (p

[GENERAL] New 8.4 features

2009-04-20 Thread Oliver Kohll - Mailing Lists
Hello, Some of the new language features in 8.4 seem like pretty major additions. I know that the window functions will be very useful. There have been many times in the past when I've wanted to aggregate in this way: http://elegantcode.com/2009/01/04/sql-window-clause/ If this is possib

Re: [DOCS] [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?

2009-04-20 Thread David Fetter
On Mon, Apr 20, 2009 at 08:13:15AM -0300, Robson Fidalgo wrote: > Hi David, > > Thanks for your help, but I want a relational-object solution. You can have one without denormalizing. Just use VIEWs and rewrite RULEs for INSERTs, UPDATEs and DELETEs on them. > The solution presented by Tom Lane

Re: [DOCS] [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?

2009-04-20 Thread Robson Fidalgo
Hi David, Thanks for your help, but I want a relational-object solution. The solution presented by Tom Lane (Thanks Tom) runs very well and it is a relational-object implementation (I suggest put a similar example in postgresql 8.3X documentation). Cheers, Robson. On Sun, Apr 19, 2009 a

Re: [GENERAL] xlog vs. shmfs

2009-04-20 Thread Martijn van Oosterhout
On Mon, Apr 20, 2009 at 09:28:20PM +0800, Botao Pan wrote: > I know that it's guaranteed to cause problems when putting xlog in a > disk mounted from shared memory, but in what scale? Am I looking at > data loss or full database cluster corruption? I'm running postgresql > 8.2.4. There is no essen

[GENERAL] Error stranger

2009-04-20 Thread paulo matadr
I get this error when make a select below "SELECT * FROM batch.funcionalidade_iniciada where proi_id = x" ERROR: missing chunk number 0 for toast value 458755 SQL state: XX000 Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com

[GENERAL] xlog vs. shmfs

2009-04-20 Thread Botao Pan
I know that it's guaranteed to cause problems when putting xlog in a disk mounted from shared memory, but in what scale? Am I looking at data loss or full database cluster corruption? I'm running postgresql 8.2.4. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chang

Re: [GENERAL] Does Postgresql 8.3X support Object/Class Methods and association between objects with REF?

2009-04-20 Thread Pavel Stehule
2009/4/20 Robson Fidalgo : > Hello, > I am study the relational-object paradigm with postgresql 8.3X and I know > that it supports composite and/or array attributes. However, I didn't find > documentation/examples about the usage of Object/Class Methods and > association between objects with REF (l

Re: [GENERAL] postgreSQL & amazon ec2 cloud

2009-04-20 Thread Stefano Nichele
Do you think that it could useful mounting two different EBS to handle data and pg_xlog ? cheers, ste -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Does Postgresql 8.3X support Object/Class Methods and association between objects with REF?

2009-04-20 Thread Robson Fidalgo
Hello, I am study the relational-object paradigm with postgresql 8.3X and I know that it supports composite and/or array attributes. However, I didn't find documentation/examples about the usage of Object/Class Methods and association between objects with REF (like oracle does). Then, I'd like to k

Re: [DOCS] [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?

2009-04-20 Thread Robson Fidalgo
On Mon, Apr 20, 2009 at 8:13 AM, Robson Fidalgo wrote: > Hi David, > > > > Thanks for your help, but I want a relational-object solution. The solution > presented by Tom Lane (Thanks Tom) runs very well and it is a > relational-object implementation (I suggest put a similar example in > postg

Re: [GENERAL] One command to rule them all?

2009-04-20 Thread Peter Eisentraut
On Sunday 19 April 2009 19:57:40 Raymond O'Donnell wrote: > I remember some time back there was a discussion about implementing a > single catch-all command for PostgreSQL, to replace (or perhaps rather > encompass) the various other utilities we currently use (psql, pg_dump, > createdb, etc etc).

[GENERAL] converting from bytea to integers

2009-04-20 Thread John DeSoi
I'd like to convert some bytea data to an array of four byte integers (and vice versa). I'm probably missing something obvious, but I don't see an efficient way to generate a 4 byte integer from a bytea string (could be big endian or little endian). Converting back to bytea seems easy enou

Re: [GENERAL] Frequently unable connecting to db "server doesn't listen"

2009-04-20 Thread Alban Hertroys
On Apr 20, 2009, at 4:10 AM, Net Tree Inc. wrote: The problem I am having has happened a few times within in a week. I am repeatly not able to connect to the db and having "server doesn't listen" message without touch anything, it just happen. First time it happen after I restarting my compu

Re: [GENERAL] Nooby Q: Should this take five hours? And counting?

2009-04-20 Thread Gregory Stark
Kenneth Tilton writes: > A bit. I killed the indexing and jacked work_mem up to 500mb, indexing then > finished in 7 min 25s. > > Yer a genius! FWIW creating indexes using maintenance_work_mem. I would not expect changing work_mem to really help much. That's, uh, curious. >> 2: You've got a slo

Re: [GENERAL] DISTINCT ON without ORDER BY

2009-04-20 Thread Gregory Stark
Martijn van Oosterhout writes: > SELECT * FROM foo > WHERE id in (SELECT max(id) FROM foo GROUP BY bar); > > Is there a way to acheive the above result without a sort and without a > self-join? Something like SELECT bar, (magic_agg_func(foo)).* FROM foo GROUP BY bar where you define an aggrega