Re: [GENERAL] Query not using the indexes properly.

2009-10-01 Thread David Wilson
On Thu, Oct 1, 2009 at 10:21 PM, Tim Uckun wrote: > > Interesting. I would have thought the order of the fields would not > matter. I don't have to rewrite the query do I? > > No. For multi-column indices, however, postgres can, starting at the leftmost in the index, use as many columns as match

Re: [GENERAL] Query not using the indexes properly.

2009-10-01 Thread Tim Uckun
> > If you try the multi-column index (which is a good idea), be sure that "id" > is the last of the three columns, since that's the column on which you have > an inequality test rather than an equality test; eg, > (company_id,source_model_name,id). > Interesting. I would have thought the order o

Re: [GENERAL] Query not using the indexes properly.

2009-10-01 Thread Tim Uckun
> It probably thinks the id check is going to be better to limit the result > set. > > How many records are there for id > 1935759 ? About 40 million or so. > vs > How many records for company_id = 4 and source_model_name = > 'CommissionedVisit' ? > > If this is a common query you could probably

Re: [GENERAL] Query not using the indexes properly.

2009-10-01 Thread David Wilson
On Thu, Oct 1, 2009 at 10:04 PM, Chris wrote: > Tim Uckun wrote: > > If this is a common query you could probably do a multi-column index on all > 3 columns (id, company_id, source_model_name) - but if company_id and > source_model_name have a low number of distinct values, then it's not going >

Re: [GENERAL] Query not using the indexes properly.

2009-10-01 Thread Chris
Tim Uckun wrote: I have a pretty simple query on a pretty simple table with about 60 million records in it. This is the query. SELECT * FROM "changes" WHERE (id > 1935759 and company_id = 4 and source_model_name = 'CommissionedVisit') ORDER BY id ASC LIMIT 1 The id field is the primary key. T

[GENERAL] Query not using the indexes properly.

2009-10-01 Thread Tim Uckun
I have a pretty simple query on a pretty simple table with about 60 million records in it. This is the query. SELECT * FROM "changes" WHERE (id > 1935759 and company_id = 4 and source_model_name = 'CommissionedVisit') ORDER BY id ASC LIMIT 1 The id field is the primary key. The other fields are

[GENERAL] Programming interfaces when using MD5 authentication

2009-10-01 Thread Preston de Guise
Hi, I apologise in advance if this is considered the wrong list to post onto. I couldn't find specific details for joining a DBD::Pg style mailing list so I'm hoping this is something that's relatively well known about by general PostgreSQL developers anyway. Using Perl to program interfa

Re: [GENERAL] Weird behavior with "sensitive" cursors.

2009-10-01 Thread Alvaro Herrera
This one really works and includes a basic test case. You were right that the extra Register was bogus :-( I had to expose CopySnapshot, which I still don't like but ... (I could have added an extra Unregister somewhere during portal close, but it would have meant making everything messier). -

Re: [GENERAL] Procedure for feature requests?

2009-10-01 Thread Alvaro Herrera
Tim Landscheidt wrote: > Hi, > > suppose I thought that PostgreSQL would benefit greatly from > a "generate_series(DATE, DATE[, INT]) RETURNS DATE" function > - where do I suggest such a thing? Here on -general? On > -hackers? Directly edit > http://wiki.postgresql.org/wiki/Todo>? I think direct

[GENERAL] Procedure for feature requests?

2009-10-01 Thread Tim Landscheidt
Hi, suppose I thought that PostgreSQL would benefit greatly from a "generate_series(DATE, DATE[, INT]) RETURNS DATE" function - where do I suggest such a thing? Here on -general? On -hackers? Directly edit http://wiki.postgresql.org/wiki/Todo>? Suppose the feature request was not a trivial one,

Re: [GENERAL] Weird behavior with "sensitive" cursors.

2009-10-01 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera writes: > > Tom Lane escribi�: > >> I don't think that testing rowMarks is the right thing at all here. > >> That tells you whether it's a SELECT FOR UPDATE, but actually we > >> want any cursor (and only cursors) to have a private snapshot. > > > The attached

Re: [GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread Tom Lane
APseudoUtopia writes: >> Here's what happened: >> >> $ vacuumdb --all --full --analyze --no-password >> vacuumdb: vacuuming database "postgres" >> vacuumdb: vacuuming database "web_main" >> vacuumdb: vacuuming of database "web_main" failed: ERROR:  huge tuple > PostgreSQL 8.4.0 on i386-portbld-

Re: [GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread Alvaro Herrera
Scott Marlowe escribió: > Wow, that's pretty slow. I'd assumed it was a semi-automated process > and the new version would be out now, 3 weeks later. At least look > through the release notes to see if any mention is made of this bug > being fixed in 8.4.1 I guess. Both files on which that erro

Re: [GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread Scott Marlowe
On Thu, Oct 1, 2009 at 2:27 PM, APseudoUtopia wrote: > On Thu, Oct 1, 2009 at 4:21 PM, Scott Marlowe wrote: >> On Thu, Oct 1, 2009 at 1:12 PM, APseudoUtopia >> wrote: >> >>> Sorry, I failed to mention: >>> >>> PostgreSQL 8.4.0 on i386-portbld-freebsd7.2, compiled by GCC cc (GCC) >>> 4.2.1 20070

Re: [GENERAL] Weird behavior with "sensitive" cursors.

2009-10-01 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane escribió: >> I don't think that testing rowMarks is the right thing at all here. >> That tells you whether it's a SELECT FOR UPDATE, but actually we >> want any cursor (and only cursors) to have a private snapshot. > The attached patch implements this. I intend

Re: [GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread APseudoUtopia
On Thu, Oct 1, 2009 at 4:21 PM, Scott Marlowe wrote: > On Thu, Oct 1, 2009 at 1:12 PM, APseudoUtopia wrote: > >> Sorry, I failed to mention: >> >> PostgreSQL 8.4.0 on i386-portbld-freebsd7.2, compiled by GCC cc (GCC) >> 4.2.1 20070719  [FreeBSD], 32-bit > > Have you tried updating to 8.4.1 to see

Re: [GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread Scott Marlowe
On Thu, Oct 1, 2009 at 1:12 PM, APseudoUtopia wrote: > Sorry, I failed to mention: > > PostgreSQL 8.4.0 on i386-portbld-freebsd7.2, compiled by GCC cc (GCC) > 4.2.1 20070719  [FreeBSD], 32-bit Have you tried updating to 8.4.1 to see if that fixes the problem? -- Sent via pgsql-general mailing

Re: [GENERAL] Weird behavior with "sensitive" cursors.

2009-10-01 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera writes: > > Tom Lane escribió: > >> Well, the first problem is that 8.4 is failing to duplicate the > >> historical behavior. > > > Oh! That's easy. > > I don't think that testing rowMarks is the right thing at all here. > That tells you whether it's a SELECT

Re: [GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread APseudoUtopia
On Thu, Oct 1, 2009 at 3:10 PM, APseudoUtopia wrote: > Hey list, > > After some downtime of my site while completing rigorous database > maintenance, I wanted to make sure all the databases were fully > vacuumed and analyzed. I do run autovacuum, but since I made several > significant changes, I w

[GENERAL] Vacuumdb Fails: Huge Tuple

2009-10-01 Thread APseudoUtopia
Hey list, After some downtime of my site while completing rigorous database maintenance, I wanted to make sure all the databases were fully vacuumed and analyzed. I do run autovacuum, but since I made several significant changes, I wanted to force a vacuum before I brought my site back online. He

[GENERAL] Pg West in two weeks!

2009-10-01 Thread Joshua D. Drake
PostgreSQL Conference West is set to hit in two weeks! Running from October 16th-18th a Central Seattle Community College, this West is set to be the largest West Coast PostgreSQL conference to date. Our list of talks is up: http://www.postgresqlconference.org/2009/west/talks Our tentative sched

Re: [GENERAL] error message on install [ REPOST from pgsql-novice ]

2009-10-01 Thread Sachin Srivastava
On 10/01/2009 07:00 PM, Ounce Snow wrote: Hi, this may be a FAQ but I did not see it listed there: when I run the install (Intel Mac) I get a popup saying problem running post install step Installation may not complete correctly The database cluster initialisation failed Check the logs(/tmp/in

Re: [GENERAL] I can not drop a user/role because an object depent on it.

2009-10-01 Thread Adrian Klaver
- "Ricky Tompu Breaky" wrote: > On Wed, 30 Sep 2009 11:38:19 -0700 > Adrian Klaver wrote: > > > On Wednesday 30 September 2009 10:43:35 am Ricky Tompu Breaky > wrote: > > > Dear my friends > > > > > > I can not drop a user because another object need it. How can I > know > > > which o

Re: [GENERAL] Weird behavior with "sensitive" cursors.

2009-10-01 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera writes: > > Tom Lane escribió: > >> Well, the first problem is that 8.4 is failing to duplicate the > >> historical behavior. > > > Oh! That's easy. > > I don't think that testing rowMarks is the right thing at all here. > That tells you whether it's a SELECT

[GENERAL] error message on install [ REPOST from pgsql-novice ]

2009-10-01 Thread Ounce Snow
Hi, this may be a FAQ but I did not see it listed there: when I run the install (Intel Mac) I get a popup saying problem running post install step Installation may not complete correctly The database cluster initialisation failed what have I missed please? Greg

[GENERAL] Time Management - Training Seminar in Cape Town

2009-10-01 Thread Training
A training seminar that will put more time back in your life. A training provider registered with Services SETA Presented by South Africa's leading Speakers Dr Brian Jude and Associates present MORE HOURS IN YOUR DAY (Time management) A Dynamic Morning Seminar Time is a unique resourc

Re: [GENERAL] Collation in ORDER BY not lexicographical

2009-10-01 Thread Paul Gaspar
Thank you all very much for your help. Maximilian, we simplified your replacing code: replace(replace(replace(replace(replace(replace ($1,'Ä','A'),'Ö','O'),'Ü','U' ),'ä','a'),'ö','o'),'ü','u'); to this: translate(upper($1),'ÄÖÜ','AOU') Paul Am 29.09.2009 um 14:36 schrieb Maximilia

Re: [GENERAL] I can not drop a user/role because an object depent on it.

2009-10-01 Thread Ricky Tompu Breaky
On Wed, 30 Sep 2009 11:38:19 -0700 Adrian Klaver wrote: > On Wednesday 30 September 2009 10:43:35 am Ricky Tompu Breaky wrote: > > Dear my friends > > > > I can not drop a user because another object need it. How can I know > > which object need it? I really want to drop everything inside my

Re: [GENERAL] pg_dump and check-constraints

2009-10-01 Thread Tom Lane
"A. Kretschmer" writes: > test=# create function check_b() returns bool as $$ declare s int; begin > select into s sum(i) from b; if s > 3 then return true; else return false; > end if; end;$$ language plpgsql; > test=*# create table a (i int check(check_b())); This is unsupported, and will fa

[GENERAL] pg_dump and check-constraints

2009-10-01 Thread A. Kretschmer
Hi, For instance, i have such a database: (it is just a silly example) test=# create function check_b() returns bool as $$ declare s int; begin select into s sum(i) from b; if s > 3 then return true; else return false; end if; end;$$ language plpgsql;

Re: [GENERAL] Boolean storage takes up 1 byte?

2009-10-01 Thread Thom Brown
2009/10/1 Sam Mason > > bool_or and bool_and are aggregates that work over boolean data types. > > Ah yes, that makes total sense! I knew max wouldn't be logical in such as case, but couldn't think of the alternative. Thanks! > > I believe it's more to do with the fact that if you add a boole

Re: [GENERAL] Boolean storage takes up 1 byte?

2009-10-01 Thread Sam Mason
On Thu, Oct 01, 2009 at 11:37:40AM +0100, Thom Brown wrote: > I've read the PostgreSQL documentation page on the boolean datatype ( > http://www.postgresql.org/docs/8.4/static/datatype-boolean.html) to find out > what PostgreSQL's definition of a boolean is, as I believe it is distinctive > from a

[GENERAL] Boolean storage takes up 1 byte?

2009-10-01 Thread Thom Brown
Hi, I've read the PostgreSQL documentation page on the boolean datatype ( http://www.postgresql.org/docs/8.4/static/datatype-boolean.html) to find out what PostgreSQL's definition of a boolean is, as I believe it is distinctive from a bit(1) datatype (as you can't max() a boolean.. not sure what a

[GENERAL] [OT] Relocation lookup

2009-10-01 Thread Rakotomandimby Mihamina
Hi all, Given the Social and Political reality in my country (Madagascar), I am obliged to look for a relocation. This is my public profile: http://www.linkedin.com/in/mihaminarakotomandimby Would you be aware of a position I could fit in? Thank you. -- Architecte Informatique chez Blueli