[GENERAL] missing chunk number (Bug 5507)

2011-01-16 Thread bubba postgres
I found this link: http://postgresql.1045698.n5.nabble.com/BUG-5507-missing-chunk-number-0-for-toast-value-X-in-pg-toast-X-td2126674.html And am also experiencing the same issue... More anecdotal evidence that this is a bug: We recently(couple days ago) completely recreated the DB, and sta

Re: [GENERAL] Trigger Performance

2011-01-16 Thread Fredric Fredricson
On 01/15/2011 11:52 PM, Randall Smith wrote: Hi, I've created a trigger that checks the uniqueness of two columns in a table. Traditionally, one would use a unique constraint, but in my case, the size of the unique index would be too large and some performance loss is acceptable. However, the

Re: [GENERAL] Optimal settings for embedded system running PostgreSQL

2011-01-16 Thread Ivan Voras
On 13/01/2011 17:31, Christian Walter wrote: Von: pgsql-general-ow...@postgresql.org im Auftrag von Ivan Voras - Average read = 15,6Mb/s - 4Kbyte reads = 3,5Mb/s - 1Kbyte read = 1Mb/s This is very slow. Have you considered something more light-weight like SQLite? This is comparable to a s

Re: [GENERAL] iPad and Postgresql...

2011-01-16 Thread Andrej
On 17 January 2011 13:34, Jerry LeVan wrote: > Hi, Hi Jerry, > Is there an idiot installable package for MacOsX Snow Leopard that will > provide a 'better' user experience for accessing Pg via the web, especially > when viewed on the iPad? It's not perl, but have you considered http://phppgadmin

[GENERAL] iPad and Postgresql...

2011-01-16 Thread Jerry LeVan
Hi, I have an iPad and a small network of macs and fedora/windoze machines at home. I am running pg 8.4.4 on all of the 'real' computers. I have been hoping that some developer would create an iPad app that would allow me to access my home database ( i am getting a bit long in the tooth and re

Re: [GENERAL] Crosstab query on huge amount of values

2011-01-16 Thread Steve Litt
On Sunday 16 January 2011 17:40:34 Julia Jacobson wrote: > Hello everybody out there using PostgreSQL, > > A table with the results of students in different exams > > student | date_of_exam | grade > -- > Peter | 2010-09-09 | 2 > Tom | 2010-09-09 | 1 > Andy

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Thomas Kellerer
Tomas Vondra wrote on 16.01.2011 23:41: Yes, locking may in some cases lead to deadlocks, that's true. For example creating several invoices (for different days) in a single transaction may lead to a deadlock. But that's a feature, not a bug. Hmm, a single transaction cannot deadlock itself as

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Tomas Vondra
Dne 16.1.2011 22:44, Andrus Moor napsal(a): > Thank you. > >> 2. In point 2. add FOR UPDATE >> 3. Use READ COMMITED TRANSACTION ISOLATION LEVEL >> >> Don't lock tables, You wrote you can generate invoices for few days >> backward, >> so you don't need locking whole table. >> >> Don't use seqences,

[GENERAL] Crosstab query on huge amount of values

2011-01-16 Thread Julia Jacobson
Hello everybody out there using PostgreSQL, A table with the results of students in different exams student | date_of_exam | grade -- Peter | 2010-09-09 | 2 Tom | 2010-09-09 | 1 Andy| 2010-09-21 | 3 Tom | 2010-09-21 | 4 Peter | 2010-09-21 | 1

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Adrian Klaver
On Sunday 16 January 2011 1:49:43 pm Steve Litt wrote: > On Sunday 16 January 2011 16:02:12 Raymond O'Donnell wrote: > > If you have configured PG to listen on a TCP/IP port (5432 by default), > > you can also do: > > > >psql -U postgres -h localhost super > > > > Ray. > > Thanks Ray, > > You w

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Adrian Klaver
On Sunday 16 January 2011 1:49:43 pm Steve Litt wrote: > On Sunday 16 January 2011 16:02:12 Raymond O'Donnell wrote: > > If you have configured PG to listen on a TCP/IP port (5432 by default), > > you can also do: > > > >psql -U postgres -h localhost super > > > > Ray. > > Thanks Ray, > > You w

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Steve Litt
On Sunday 16 January 2011 16:02:12 Raymond O'Donnell wrote: > If you have configured PG to listen on a TCP/IP port (5432 by default), > you can also do: > >psql -U postgres -h localhost super > > Ray. Thanks Ray, You were so close! The command that works is this: psql -U super -h loca

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Raymond O'Donnell
On 16/01/2011 21:39, Steve Litt wrote: On Sunday 16 January 2011 16:02:12 Raymond O'Donnell wrote: If you have configured PG to listen on a TCP/IP port (5432 by default), you can also do: psql -U postgres -h localhost super Ray. Thanks Ray, My psql seems a lot different from others. Lo

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Andrus Moor
Thank you. 2. In point 2. add FOR UPDATE 3. Use READ COMMITED TRANSACTION ISOLATION LEVEL Don't lock tables, You wrote you can generate invoices for few days backward, so you don't need locking whole table. Don't use seqences, as sequence value will don't get back when transaction is rolled ba

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Steve Litt
On Sunday 16 January 2011 16:02:12 Raymond O'Donnell wrote: > If you have configured PG to listen on a TCP/IP port (5432 by default), > you can also do: > >psql -U postgres -h localhost super > > Ray. Thanks Ray, My psql seems a lot different from others. Loook what happened: slitt@mydes

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Raymond O'Donnell
On 16/01/2011 20:56, Steve Litt wrote: Thanks Dmitriy, It turns out the solution I used was to su to postgres in Linux, and then run the command psql without arguments, at which time I could have my way with any object. More in my responses to you... On Sunday 16 January 2011 06:21:28 Dmitriy

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Steve Litt
Thanks Dmitriy, It turns out the solution I used was to su to postgres in Linux, and then run the command psql without arguments, at which time I could have my way with any object. More in my responses to you... On Sunday 16 January 2011 06:21:28 Dmitriy Igrishin wrote: > Hey Steve, > > 2011/

[GENERAL] Re: [ANNOUNCE] Re: [pgsql-es-ayuda] Para participantes extranjeros en el Tercer PGDay Latinoamericano.

2011-01-16 Thread Fernando Hevia
En oportunidades anteriores donde me ha tocado trabajar con empresas cubanas fue la empresa la que gestionó la visa y me la enviaron escaneada. No tuve que ir a la embajada en ningún momento. Saludos, Fernando. 2011/1/11 ๏̯͡๏ Guido Barosio > Yunior, > >En Argentina el tramite de visado es p

Re: [GENERAL] HA solution

2011-01-16 Thread Adrian Klaver
On Sunday 16 January 2011 7:19:49 am Jaiswal Dhaval Sudhirkumar wrote: > Thanks for your great comments. > > I have gone through suggested link & the streaming replication with 9.0+. > (We are using PostgreSQL 8.4. Not to worry I will migrate it to 9.0+) > > It seems to me that if i will go with th

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Radosław Smogura
I will sugest to: 1. Delete point 1. 2. In point 2. add FOR UPDATE 3. Use READ COMMITED TRANSACTION ISOLATION LEVEL Don't lock tables, You wrote you can generate invoices for few days backward, so you don't need locking whole table. Don't use seqences, as sequence value will don't get back when

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Alban Hertroys
On 16 Jan 2011, at 18:56, Andrus Moor wrote: > My Visual FoxPro application works OK in this case. > I used FLOCK() to lock invoice header table (FLOCK() waits indefinitely until > lock is obtained and reads fresh data from disk), > > used > > SELECT MAX( CAST( SUBSTRING(invoiceno,8) AS INT )

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Andrus Moor
Yes. This is customer requirement and I cannot change it. OR... can you go back to your customer and tell them they wont like this. Really really they should let you do it correctly. I find people dont change because they dont have to, not because there is an actual reason. Many times, given a

Re: [GENERAL] problem

2011-01-16 Thread Raymond O'Donnell
On 16/01/2011 09:29, Kasia Nowicka wrote: hi, i have just reinstall my system which is Windows XP. I have my database on a server and after installation I can not connect to it. Error: " could not connect to server: connection refused (0x274D/10061). Is the server running on host "localhost"

Re: [GENERAL] libpq: binary data vs textual

2011-01-16 Thread Вячеслав Блинников
The claw "no, it wont switch." is enaugh. I think it's a good manner to use some default settings - will read textual data. Thanks! 16 января 2011 г. 18:11 пользователь Andy Colson написал: > On 01/16/2011 09:07 AM, Andy Colson wrote: > >> On 01/16/2011 08:13 AM, Вячеслав Блинников wrote: >> >>>

[GENERAL] problem

2011-01-16 Thread Kasia Nowicka
hi, i have just reinstall my system which is Windows XP. I have my database on a server and after installation I can not connect to it. Error: " could not connect to server: connection refused (0x274D/10061). Is the server running on host "localhost" and accepting TCP/IP connection on port 54

Re: [GENERAL] Trigger Performance

2011-01-16 Thread Tom Lane
Randall Smith writes: > I've created a trigger that checks the uniqueness of two columns in a > table. Traditionally, one would use a unique constraint, but in my > case, the size of the unique index would be too large and some > performance loss is acceptable. However, the trigger performance s

[GENERAL] Efficient count(distinct x) query question

2011-01-16 Thread Sefer Tov
Hi, I have several queries that perform something like: select count(data) as count1, count(distinct data) as count2 from large_table group by user; My problem is that this table contains about 500M records and the moment I perform a "count(distinct ...)" the planner always solved it using s

Re: [GENERAL] database slowdown

2011-01-16 Thread Andy Colson
On 01/16/2011 10:44 AM, Mag Gam wrote: I am running Redhat 5.2 Linux with Postgresql 8.4.4; When my disk space is 90% free the database performance is very good. However, when it reaches close to 20% free the database performance is bad. I know its bad because I see a lot of 'D' next to 'postgre

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Andy Colson
On 01/16/2011 11:00 AM, Andrus Moor wrote: Andy, SELECT COALESCE(MAX(nullif(substring( substring(tasudok from 7), '^[0-9]*'),'')::int),0)+1 FROM invoice where date= ?invoicedate is used to get next free invoice number if new invoice is saved. If multiple invoices are saved concurrently from

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Andrus Moor
Andy, SELECT COALESCE(MAX(nullif(substring( substring(tasudok from 7), '^[0-9]*'),'')::int),0)+1 FROM invoice where date= ?invoicedate is used to get next free invoice number if new invoice is saved. If multiple invoices are saved concurrently from different processes, they will probably get

Re: [GENERAL] Record with a field consisting of table rows

2011-01-16 Thread Alban Hertroys
On 16 Jan 2011, at 17:40, Jon Smark wrote: > Again, you're making it sound like I'm requesting something exotic, > while any language with a modern type system allows this and much > more without blinking. In Ocaml, for example, the return type 'page_t' > of my function could be defined as follow

[GENERAL] database slowdown

2011-01-16 Thread Mag Gam
I am running Redhat 5.2 Linux with Postgresql 8.4.4; When my disk space is 90% free the database performance is very good. However, when it reaches close to 20% free the database performance is bad. I know its bad because I see a lot of 'D' next to 'postgresql' process when running top and I see a

Re: [GENERAL] Record with a field consisting of table rows

2011-01-16 Thread Jon Smark
Hi, > A tuple wouldn't be unusual, but you're not asking for a > simple tuple here. What you're asking for is a value and a > set of tuples. Which is in itself a tuple! This discussion is again veering slightly off-topic, but note that tuples as mathematical objects do not have such arbitrary li

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Andy Colson
On 01/15/2011 12:13 PM, Andrus Moor wrote: Invoice numbers have format yymmddn where n is sequence number in day staring at 1 for every day. command SELECT COALESCE(MAX(nullif(substring( substring(tasudok from 7), '^[0-9]*'),'')::int),0)+1 FROM invoice where date= ?invoicedate is used to get

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-16 Thread Tomas Vondra
Dne 16.1.2011 03:29, Jasen Betts napsal(a): > On 2011-01-15, Andrus Moor wrote: >> Invoice numbers have format yymmddn >> >> where n is sequence number in day staring at 1 for every day. >> >> command >> >> SELECT COALESCE(MAX(nullif(substring( substring(tasudok from 7), >> '^[0-9]*'),'')::int),

Re: [GENERAL] HA solution

2011-01-16 Thread Jaiswal Dhaval Sudhirkumar
Thanks for your great comments. I have gone through suggested link & the streaming replication with 9.0+. (We are using PostgreSQL 8.4. Not to worry I will migrate it to 9.0+) It seems to me that if i will go with this Active/Hot stand by(stream) architecture, I can generate the report from my

Re: [GENERAL] libpq: binary data vs textual

2011-01-16 Thread Andy Colson
On 01/16/2011 09:07 AM, Andy Colson wrote: On 01/16/2011 08:13 AM, Вячеслав Блинников wrote: Database returns information from "integer" and "biging" fields as text (values represented as string which must be read via atoi()/atol()) - is there a way to retrieve such data as binary? Will not Post

Re: [GENERAL] libpq: binary data vs textual

2011-01-16 Thread Andy Colson
On 01/16/2011 08:13 AM, Вячеслав Блинников wrote: Database returns information from "integer" and "biging" fields as text (values represented as string which must be read via atoi()/atol()) - is there a way to retrieve such data as binary? Will not PostgreSQL suddenly start return information in

[GENERAL] libpq: binary data vs textual

2011-01-16 Thread Вячеслав Блинников
Database returns information from "integer" and "biging" fields as text (values represented as string which must be read via atoi()/atol()) - is there a way to retrieve such data as binary? Will not PostgreSQL suddenly start return information in binary format (while I will continue read it as text

Re: [GENERAL] Need help writing exclusion constraint

2011-01-16 Thread Andreas Kretschmer
Matthew Wilson wrote: > I have a table like this: > > create table event( > > destination_id integer not null references destination > (destination_id), > > starts timestamp, > ends timestamp > ); > > I want to make sure that no two rows **with the same destination_id** > over

Re: [GENERAL] Why can't I change a password

2011-01-16 Thread Dmitriy Igrishin
Hey Steve, 2011/1/16 Steve Litt > Hi all, > > I've somehow messed up something. > > psql super > psql's synopsis is psql [option...] [dbname [username]] Thus, the call "psql super" connects psql to a database "super" but since username unspecified it is connected with current Unix user (w

Re: [GENERAL] Trigger Performance

2011-01-16 Thread Alban Hertroys
On 16 Jan 2011, at 5:38, Randall Smith wrote: >> But you already do have an index on that id-field, so what's the problem >> with using a unique constraint? Its unique index could just replace the >> existing one. > > I'm OK with indexing the 8 byte integer, but I don't want to index the > text

[GENERAL] Why can't I change a password

2011-01-16 Thread Steve Litt
Hi all, I've somehow messed up something. psql super psql (8.4.5) Type "help" for help. super=> \du+ List of roles Role name | Attributes | Member of | Description ---+-+---+- bobo | | {}| junk |