[GENERAL] unable to avoid a deadlock at the end of a long transaction

2010-05-07 Thread Ivan Sergio Borgonovo
I've been having this: psql:include/custom/import_update.custom.sql:63: ERROR: deadlock detected DETAIL: Process 13349 waits for AccessExclusiveLock on relation 250510 of database 248569; blocked by process 14153. Process 14153 waits for ShareLock on transaction 59160779; blocked by process 1334

[GENERAL] Getting pgsnmpd using rsync/sup

2010-05-07 Thread Sandeep Thakkar
I checkout the pgsnmpd using command "cvs -d pserver:anonym...@cvs.pgfoundry.org:/cvsroot/pgsnmpd checkout -r REL1_0 pgsnmpd" Now, I want to setup the local mirror and wants to checkout the sources from there. I use the following command: $rsync -av cvs.pgfoundry.org:/cvsroot/pgsnmpd/* . Passw

Re: [GENERAL] missing chunk number 0 for toast value 25693266 in pg_toast_25497233

2010-05-07 Thread Magnus Hagander
On Fri, May 7, 2010 at 01:24, Bryan Murphy wrote: > I'm running into this issue again: > > psql --version > psql (PostgreSQL) 8.3.7 > > COPY items_extended TO '/dev/null'; > ERROR:  missing chunk number 0 for toast value 25693266 in pg_toast_25497233 > > Unfortunately, I do not know where these ar

Re: [GENERAL] unable to avoid a deadlock at the end of a long transaction

2010-05-07 Thread Tom Lane
Ivan Sergio Borgonovo writes: > I've been having this: > psql:include/custom/import_update.custom.sql:63: ERROR: deadlock > detected DETAIL: Process 13349 waits for AccessExclusiveLock on > relation 250510 of database 248569; blocked by process 14153. > Process 14153 waits for ShareLock on trans

Re: [GENERAL] missing chunk number 0 for toast value 25693266 in pg_toast_25497233

2010-05-07 Thread Bryan Murphy
On Fri, May 7, 2010 at 9:02 AM, Magnus Hagander wrote: > Try doing a binary search with LIMIT. E.g., if you have 20M reecords, > do a SELECT * FROM ... LIMIT 10M. (throw away the results) If that > broke, check the upper half, if not, check the lower one (with > OFFSET). > > If you have a serial p

[GENERAL] Formatted reports

2010-05-07 Thread Sorin Schwimmer
Hi All, Is there in PostgreSQL an equivalent of Oracle's BREAK/COMPUTE reporting feature? Thanks, SxN -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] unable to avoid a deadlock at the end of a long transaction

2010-05-07 Thread Ivan Sergio Borgonovo
On Fri, 07 May 2010 10:29:20 -0400 Tom Lane wrote: > Ivan Sergio Borgonovo writes: > > I've been having this: > > psql:include/custom/import_update.custom.sql:63: ERROR: deadlock > > detected DETAIL: Process 13349 waits for AccessExclusiveLock on > > relation 250510 of database 248569; blocked

Re: [GENERAL] Formatted reports

2010-05-07 Thread Filip Rembiałkowski
2010/5/7 Sorin Schwimmer : > Hi All, > > Is there in PostgreSQL an equivalent of Oracle's BREAK/COMPUTE reporting > feature? No, there isn't. You need some procedural language function, or use external tool to accomplish this. There are free reporting engines. jaspersoft, pentaho, BIRT, ... [[

Re: [GENERAL] password management

2010-05-07 Thread Christophe Dore
Hi IMHO, you should never store password in clear If you store the last 5 crypted passwords, then you can make it comparing the new password, crypted, to those 5 strings. Regards -- Christophe Doré Implementation Product Manager 3 rue Marcel Allegot 92190 Meudon, France +33

[GENERAL] initdb fails on Centos 5.4 x64

2010-05-07 Thread Valentin Hocher
Hi, i've tried to install 8.4.3 for about two days, but i don't get it. 8.1.x has been installed before and was runnig but never used. I've removed it with yum and wiped /var/lib/pgsl. -=>> service postgresql initdb Initializing database: [FAILED] -=>> cat

[GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread AllieH
Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is requiring me to use PostgreSQL 8.4 instead of 8.3 which I was previously using. I tried installing 8.4 but I can't

[GENERAL] what's the relation between pathkey and path in optimize phase?

2010-05-07 Thread sunpeng
what's the relation between pathkey and path in optimize phase? thanks peng

[GENERAL] when to update pg_statistic relation?

2010-05-07 Thread sunpeng
when to update pg_statistic relation? is it when inserting a new tuple of any user's relations? and the relation pg_stats at document 8.4 chapter 44.55.pg_stats hasn't been used anymore ? another question is: I noticed when i send the sql :"select catcode from pois goup by catcode", the function :d

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Alan Hodgson
On Friday 07 May 2010, AllieH wrote: > Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has > caused me serious problems with everything related to postgreSQL. It > seems as though the new version of ubuntu is requiring me to use > PostgreSQL 8.4 instead of 8.3 which I was prev

[GENERAL] list of databases in C ? libpq ?

2010-05-07 Thread Joao Ferreira gmail
Hello all, I need to write an application in C to read the list of databases currently in the server. very much like a "psql -l"... but I need it in C ! I never used C before to access PG. the libpq API seems a bit scary ! Is there anything, shipped with postgresql, other than libpq that would m

Re: [GENERAL] initdb fails on Centos 5.4 x64

2010-05-07 Thread Tom Lane
valentin.hoc...@kabelbw.de (Valentin Hocher) writes: > creating conversions ... FATAL: could not load library > "/usr/lib64/pgsql/utf8_and_shift_jis_2004.so": > /usr/lib64/pgsql/utf8_and_shift_jis_2004.so: failed to map segment from > shared object: Cannot allocate memory Hmm, there was someth

Re: [GENERAL] what's the relation between pathkey and path in optimize phase?

2010-05-07 Thread Tom Lane
sunpeng writes: > what's the relation between pathkey and path in optimize phase? pathkey is a data structure representing the ordering of a path. Have you read src/backend/optimizer/README ? regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgr

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Steve Crawford
AllieH wrote: Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is requiring me to use PostgreSQL 8.4 instead of 8.3 which I was previously using. I tried installing

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Steve Clark
On 05/07/2010 12:10 PM, AllieH wrote: Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is requiring me to use PostgreSQL 8.4 instead of 8.3 which I was previously u

Re: [GENERAL] list of databases in C ? libpq ?

2010-05-07 Thread Alex Hunsaker
On Fri, May 7, 2010 at 11:18, Joao Ferreira gmail wrote: > Hello all, > > I need to write an application in C to read the list of databases > currently in the server. very much like a "psql -l"... select datname as database from pg_database; > but I need it in C ! I never used C before to access

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread AllieH
Thanks for all the help - I needed to an initdb and then I also had to do: sudo dpkg -i /var/cache/pat/archives/postgresql-client-8.4_8.4.3-1_i386.deb but it's finally working!! Now I just have to get all my data back but after this headache I think that will be comparatively easy! Thanks for a

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Steve Clark
On 05/07/2010 01:22 PM, Alan Hodgson wrote: On Friday 07 May 2010, AllieH wrote: Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is requiring me to use Post

Re: [GENERAL] list of databases in C ? libpq ?

2010-05-07 Thread Steve Atkins
On May 7, 2010, at 10:18 AM, Joao Ferreira gmail wrote: > Hello all, > > I need to write an application in C to read the list of databases > currently in the server. very much like a "psql -l"... > > but I need it in C ! I never used C before to access PG. > > the libpq API seems a bit scary !

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Yeb Havinga
AllieH wrote: Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is requiring me to use PostgreSQL 8.4 instead of 8.3 which I was previously using. I tried installing

[GENERAL] Question about joins, left outer and others

2010-05-07 Thread Jeff Ross
This is going to be simple, I'm sure, but I'm stumped. It's a little long but I thought as I wrote it out I'd get the aha! moment and since that didn't happen, here goes. I have a table of education categories: jr...@wykids localhost# \d education_categories

Re: [GENERAL] Formatted reports

2010-05-07 Thread Sorin Schwimmer
Definitely SQL*PLUS, you're right. I managed to create a report as a UNION select between data and SUMs of data queries, with relevant fields for GROUPing and ORDERing. I would have liked to be able to get these "relevant fields" shown only once, so I started to check what is available, and stu

Re: [GENERAL] Question about joins, left outer and others

2010-05-07 Thread Andy Colson
On 5/7/2010 2:38 PM, Jeff Ross wrote: This is going to be simple, I'm sure, but I'm stumped. It's a little long but I thought as I wrote it out I'd get the aha! moment and since that didn't happen, here goes. snip To get the output I want above, I'd think I'd need to do a left outer join li

Re: [GENERAL] Question about joins, left outer and others

2010-05-07 Thread Tom Lane
Jeff Ross writes: > To get the output I want above, I'd think I'd need to do a left outer join > like this: > jr...@wykids localhost# select ed_cat_name as "Level", pp_ed_cat_subject as > "Subject", pp_ed_cat_institution as "Institution" from > education_categories left outer join people_educat

Re: [GENERAL] Question about joins, left outer and others

2010-05-07 Thread Jeff Ross
Tom Lane wrote: Jeff Ross writes: To get the output I want above, I'd think I'd need to do a left outer join like this: jr...@wykids localhost# select ed_cat_name as "Level", pp_ed_cat_subject as "Subject", pp_ed_cat_institution as "Institution" from education_categories left outer join peo

[GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread hernan gonzalez
(Disclaimer: I've been using Postgresql for quite a long time, I usually deal with non-ascii LATIN-9 characters , but that has never been a problem, until now) My issue summarized: when psql is invoked from a user who has a locale different from that of the database, the tabular output is wrong fo

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread Tom Lane
hernan gonzalez writes: > My scenario: Fedora 12, Postgresql 8.4.3 compiled from source. > Database encoding (global) LATIN9. > User postgres locale: LANG=en_US.iso885915, > User root locale LANG=en_US.UTF-8 > When I connect from postgres user, all is right. > When I connect from root, it's not

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread hernan gonzalez
It's surely not a xterm problem, I see the characters ok with just the \x formatting. I can check also the output redirecting to a file. My original client_encoding seems to be LATIN9 in both cases, accorging to the \set ouput. If I change it (for the root user) to UTF8 with " SET CLIENT_ENCODING

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread Tom Lane
hernan gonzalez writes: > But I actually dont want that. I want psql to not try any charset > conversion, just give me the raw text as is stored in the db. Well, that's what it's doing (given the default setting with client_encoding equal to server_encoding), and then xterm is misdisplaying the t

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread hernan gonzalez
Mmm no: \x displays correctly for me because it sends the raw text (in LATIN9) and I have set my terminal in LATIN9 (or ISO-8859-15) And it's not that "xterm is misdisplaying" the text, it just that psql is ouputting an EMPTY (zero lenght) string for that field. (I can even send the output to a

Re: [GENERAL] initdb fails on Centos 5.4 x64

2010-05-07 Thread Tom Lane
valentin.hoc...@kabelbw.de (Valentin Hocher) writes: > creating conversions ... FATAL: could not load library > "/usr/lib64/pgsql/utf8_and_shift_jis_2004.so": > /usr/lib64/pgsql/utf8_and_shift_jis_2004.so: failed to map segment from > shared object: Cannot allocate memory FWIW, I tried to dupl

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread Tom Lane
hernan gonzalez writes: > The issue is that psql tries (apparently) to convert to UTF8 > (even when he plans to output the raw text -LATIN9 in this case) > just for computing the lenght of the field, to build the table. > And because for this computation he (apparently) rely on the string > routin

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread hgonzalez
However, it appears that glibc's printf code interprets the parameter as the number of *characters* to print, and to determine what's a character it assumes the string is in the environment LC_CTYPE's encoding. Well, I myself have problems to believe that :-) This would be nasty... Are you sure?

Re: [GENERAL] psql weird behaviour with charset encodings

2010-05-07 Thread hernan gonzalez
Sorry about a error in my previous example (mixed width and precision). But the conclusion is the same - it works on bytes: #include main () { char s[] = "ni\xc3\xb1o"; /* 5 bytes , 4 utf8 chars */ printf("|%*s|\n",6,s); /* this should pad a black */ printf("|%.*s|\n",4,s);

[GENERAL] peer-to-peer replication with Postgres

2010-05-07 Thread Mike Christensen
I'm considering using a cloud hosting solution for my website. It will probably be either Amazon, Rackspace or Hosting.com. I'm still comparing. Either way, my site will consist of multiple virtual server instances that I can create and destroy as needed. Each virtual machine instance will be s