[GENERAL] Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!

2011-10-28 Thread Mohamed Hashim
I have Quadcore server with 8GB RAM vendor_id : GenuineIntel cpu family : 6 model : 44 model name : Intel(R) Xeon(R) CPU E5607 @ 2.27GHz stepping: 2 cpu MHz : 1197.000 cache size : 8192 KB MemTotal:8148636 kB MemFree:

[GENERAL] Named column default expression

2011-10-28 Thread Thomas Kellerer
Hello, I just noticed that Postgres allows the following syntax: create table foo ( id integer constraint id_default_value default 42 ); But as far as I can tell the constraint id_default_value part seems to be only syntactical sugar as this is stored nowhere. At least I couldn't find it

Re: [GENERAL] Server hitting 100% CPU usage, system comes to a crawl.

2011-10-28 Thread Radosław Smogura
On Thu, 27 Oct 2011 12:43:00 -0700, John R Pierce wrote: On 10/27/11 11:39 AM, Brian Fehrle wrote: I've got a system that has 32 cores and 128 gigs of ram. We have connection pooling set up, with about 100 - 200 persistent connections open to the database. Our applications then use these

[GENERAL] Re: [PERFORM] Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!

2011-10-28 Thread Gregg Jaskiewicz
what sort of queries you are running against it ? the select * from.. is not really (hopefully) a query you are running from your php app. -- 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] Named column default expression

2011-10-28 Thread Thom Brown
On 28 October 2011 08:29, Thomas Kellerer spam_ea...@gmx.net wrote: Hello, I just noticed that Postgres allows the following syntax: create table foo (    id integer constraint id_default_value default 42 ); But as far as I can tell the constraint id_default_value part seems to be only

Re: [GENERAL] Custom data type in C with one fixed and one variable attribute

2011-10-28 Thread Adrian Schreyer
I added one more byte to include \0 and its working as expected now. Thanks for your help! Cheers, Adrian On Thu, Oct 27, 2011 at 23:23, Tom Lane t...@sss.pgh.pa.us wrote: Adrian Schreyer ams...@cam.ac.uk writes: The data type I have is typedef struct {         int4   length;        

Re: [GENERAL] Named column default expression

2011-10-28 Thread Thomas Kellerer
Thom Brown, 28.10.2011 10:10: On 28 October 2011 08:29, Thomas Kellererspam_ea...@gmx.net wrote: Hello, I just noticed that Postgres allows the following syntax: create table foo ( id integer constraint id_default_value default 42 ); But as far as I can tell the constraint

[GENERAL] PG_DUMP error : unexpected chunk number

2011-10-28 Thread mailtolouis2020-postg...@yahoo.com
Hello, I think I got a big problem now, I'm not able to do pg_dump on one of my production database. When I do pg_dump it give me this error: pg_dump: Error message from server: ERROR:  unexpected chunk number 18390760 (expected 4) for toast value 92784 in pg_toast_88487 I believe this

Re: [GENERAL] Server move using rsync

2011-10-28 Thread Venkat Balaji
Another option is to use rsync to perform a file system backup. This is done by first running rsync while the database server is running, then shutting down the database server just long enough to do a second rsync. The second rsync will be much quicker than the first, because it has

[GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Robert Buckley
Hi, according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however said about in which character set.  Am I allowed to name a table field

Re: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Szymon Guz
On 28 October 2011 12:49, Robert Buckley robertdbuck...@yahoo.com wrote: Hi, according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however

Re: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Thomas Kellerer
Robert Buckley, 28.10.2011 12:49: according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however said about in which character set. Am I allowed to

WG: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Robert Buckley
- Weitergeleitete Message - Von: Robert Buckley robertdbuck...@yahoo.com An: Szymon Guz mabew...@gmail.com Gesendet: 13:23 Freitag, 28.Oktober 2011 Betreff: Re: [GENERAL] PostgreSQL Naming Rules Thanks, I tried importing a table and I got some errors regarding Character sets. The

Re: [GENERAL] Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!

2011-10-28 Thread Alban Hertroys
On 28 October 2011 09:02, Mohamed Hashim nmdhas...@gmail.com wrote: EXPLAIN select * from stk_source ; QUERY PLAN -  Result  (cost=0.00..6575755.39 rows=163132513 width=42)

Re: [GENERAL] Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!

2011-10-28 Thread Alban Hertroys
On 28 October 2011 13:37, Alban Hertroys haram...@gmail.com wrote: On 28 October 2011 09:02, Mohamed Hashim nmdhas...@gmail.com wrote: Please don't cross-post to mailing lists for multiple projects. -- If you can't see the forest for the trees, Cut the trees and you'll see there is no forest.

Re: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Albe Laurenz
Robert Buckley wrote: according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however said about in which character set. Am I allowed to name

Re: [GENERAL] Named column default expression

2011-10-28 Thread Tom Lane
Thomas Kellerer spam_ea...@gmx.net writes: I just noticed that Postgres allows the following syntax: create table foo ( id integer constraint id_default_value default 42 ); I'm wondering why this doesn't throw an error then. It's an implementation artifact --- our grammar regards

Re: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Adrian Klaver
On Friday, October 28, 2011 3:49:58 am Robert Buckley wrote: Hi, according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however said about in

[GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread depstein
I just found an odd thing about nextval (PostgreSQL 9.0): When nextval is called together with a function returning a sequence, such as generate_series or unnest, it skips one value between consecutive calls: create sequence test_sequence; -- This works as expected select nextval('

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread Tom Lane
depst...@alliedtesting.com writes: -- This is rather surprising select nextval(' test_sequence'), generate_series(1, 1); -- 3, 1 select nextval(' test_sequence'), generate_series(1, 1); -- 5, 1 Is there any explanation for why nextval skips a value in the second case? The targetlist is

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread depstein
-Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Friday, October 28, 2011 7:22 PM To: Dmitry Epstein Cc: pgsql-general@postgresql.org; Peter Gagarinov Subject: Re: [GENERAL] nextval skips values between consecutive calls depst...@alliedtesting.com writes: --

[GENERAL] Client-site lo_export

2011-10-28 Thread whiplash
Hello! I use client-side lo_export for save large object to file. If i login as database owner then i do not have error (output file exists), but if i login as not database owner then function lo_export returning -1. My code is simple: PGresult *res = PQexec(pg_conn, begin); PQclear(res);

[GENERAL] pg_dump error unexpected chunk number

2011-10-28 Thread Louis Voo
Hello, I think I got a big problem now, I'm not able to do pg_dump on one of my production database. When I do pg_dump it give me this error: pg_dump: Error message from server: ERROR:  unexpected chunk number 18390760 (expected 4) for toast value 92784 in pg_toast_88487 I believe this

Re: [GENERAL] Unable to write inside TEMP environment variable path

2011-10-28 Thread kucoj
i solved this problem. follow this video http://www.youtube.com/watch?v=aFZnPw4p4eo -- View this message in context: http://postgresql.1045698.n5.nabble.com/Unable-to-write-inside-TEMP-environment-variable-path-tp3315027p4945094.html Sent from the PostgreSQL - general mailing list archive at

Re: [GENERAL] Named column default expression

2011-10-28 Thread Thomas Kellerer
Tom Lane wrote on 28.10.2011 16:21: I just noticed that Postgres allows the following syntax: create table foo ( id integer constraint id_default_value default 42 ); I'm wondering why this doesn't throw an error then. It's an implementation artifact --- our grammar regards everything after

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread Merlin Moncure
On Fri, Oct 28, 2011 at 10:28 AM, depst...@alliedtesting.com wrote: -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Friday, October 28, 2011 7:22 PM To: Dmitry Epstein Cc: pgsql-general@postgresql.org; Peter Gagarinov Subject: Re: [GENERAL] nextval skips values

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread depstein
-Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Friday, October 28, 2011 8:29 PM To: Dmitry Epstein Cc: t...@sss.pgh.pa.us; pgsql-general@postgresql.org; Peter Gagarinov Subject: Re: [GENERAL] nextval skips values between consecutive calls On Fri, Oct 28,

[GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
Hello, in PostgreSQL 8.4.9 I'm able to select all games and his partners by a player id: # select * from pref_scores s1 join pref_scores s2 using(gid) join pref_games g using(gid) where s1.id='OK531282114947'; gid | id | money | quit | id | money | quit | rounds |

Re: [GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
First half is delete from pref_scores where gid in (select gid from pref_scores where id=_id); but how to clean pref_games? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
Nevermind, sorry - I've figured it out myself (for a change) delete from pref_scores where id_id and gid in (select gid from pref_scores where id=_id); delete from pref_games where gid in (select gid from pref_scores where

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread Merlin Moncure
On Fri, Oct 28, 2011 at 11:32 AM, depst...@alliedtesting.com wrote: -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Friday, October 28, 2011 8:29 PM To: Dmitry Epstein Cc: t...@sss.pgh.pa.us; pgsql-general@postgresql.org; Peter Gagarinov Subject: Re:

Re: [GENERAL] From select to delete

2011-10-28 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alexander Farber Sent: Friday, October 28, 2011 12:34 PM To: pgsql-general Subject: [GENERAL] From select to delete Hello, Is there maybe an easy way to delete that player

Re: [GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
Thank you, David - On Fri, Oct 28, 2011 at 7:00 PM, David Johnston pol...@yahoo.com wrote: The easiest way is to create FOREIGN KEY relationships between the various tables and allow ON DELETE CASCADE to do the work. Otherwise you need to DELETE with an appropriate WHERE clause (and

Re: [GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
For now I'm trying to finish my 1st approach (without on delete cascade) and the following strangely fails with ERROR: syntax error at temp DETAIL: Expected record variable, row variable, or list of scalar variables following INTO. CONTEXT: compilation of PL/pgSQL function pref_delete_user

Re: [GENERAL] From select to delete

2011-10-28 Thread Alban Hertroys
On 28 Oct 2011, at 19:40, Alexander Farber wrote: For now I'm trying to finish my 1st approach (without on delete cascade) and the following strangely fails with ERROR: syntax error at temp DETAIL: Expected record variable, row variable, or list of scalar variables following INTO.

Re: [GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
On Fri, Oct 28, 2011 at 7:49 PM, Alban Hertroys haram...@gmail.com wrote: SELECT INTO in PL/pgSQL isn't the same command as SELECT INTO in SQL. Check the documentation for the two ;) Alban Hertroys Thanks and I'm not surprised about this news... -- Sent via pgsql-general mailing list

Re: [GENERAL] Client-site lo_export

2011-10-28 Thread Dmitriy Igrishin
Hey, 2011/10/28 whiplash whipl...@bss.org.ua Hello! I use client-side lo_export for save large object to file. If i login as database owner then i do not have error (output file exists), but if i login as not database owner then function lo_export returning -1. My code is simple:

Re: [GENERAL] From select to delete

2011-10-28 Thread Alexander Farber
This seems to work (I'm not sure if ON COMMIT DROP is needed or not - I'm using non-persistent PHP 5.3 script with pgbouncer pool_mode=session and PostgreSQL 8.4.9): create or replace function pref_delete_user(_id varchar, _reason varchar) returns void as $BODY$

Re: [GENERAL] PG 9.1.1 - availability of xslt_process()

2011-10-28 Thread aperi2007
Hi Vibor, thx for hint. it resolve. Really great new the extension command ! Best regards, Il 27/10/2011 08:47, Vibhor Kumar ha scritto: On Oct 27, 2011, at 11:43 AM, Andrea Peri wrote: Hi, I'm using the compiled version of PG 9.1.1 on win32 . try-ing to call the

Re: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Craig Ringer
On 10/28/2011 06:49 PM, Robert Buckley wrote: according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however said about in which character set. Am