Re: [GENERAL] Importance of re-index

2006-08-19 Thread Nicolas Barbier
2006/8/10, Ron Johnson [EMAIL PROTECTED]: How aggressively does PostgreSQL keep b-trees in balance? Inserting the range [1..1000] should result in a right- unbalanced tree. Are you talking about a tree that is unbalanced regarding its height (ie, has some leaves that are further away

Re: [GENERAL] Query optimization and indexes

2006-08-19 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Before (if memory serves) 8.1, the planner would only consider leading index columns as potential indexscan qualifiers. So given where a = 5 and c = 4; only the a = 5 clause would be used with the index. As of 8.1 it will consider using

[GENERAL] problem with postgres SQL db

2006-08-19 Thread Rodion Raskolnikov
hi. my name is grzegorz. i have som problem with postgres sql.i am sorry because my english is very bad, but i dont have any other chance to contact with you.in the company when i work we hame 2 www servers, at the older we have postres 7.2, and at the new we have postgres 8.1. we have to insert

[GENERAL] Cast null string '' to integer 0

2006-08-19 Thread Dwight Emmons
I am upgrading from Postgres 7.2 to 8.1. We have multiple systems already in place that took advantage of the implicit cast of a null string to an integer of 0. It is not financially feasible for us to modify all the instances. Does anyone know of a fix? Any help would be appreciated

[GENERAL] Arrays and backslashes

2006-08-19 Thread Colin DuPlantis
I'm running: colin=# select version(); version --- PostgreSQL 8.1.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc

[GENERAL] Database GUI creater that exports to SQL

2006-08-19 Thread Shervin Asgari
Hello, does anyone know of any applications that can create database easily using an interface which exports to SQL so that I can just run it in postgresql? -- Shervin Asgari ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Database GUI creater that exports to SQL

2006-08-19 Thread Shervin Asgari
I forgot to say that I preferably want a free utility that works on Ubuntu. Shervin Asgari Shervin Asgari wrote: Hello, does anyone know of any applications that can create database easily using an interface which exports to SQL so that I can just run it in postgresql?

Re: [GENERAL] Query optimization and indexes

2006-08-19 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: only the a = 5 clause would be used with the index. As of 8.1 it will consider using nonconsecutive index columns Really? Is this the skip scan plan people were pining for? No, there's no skip scan, it just applies

Re: [GENERAL] Connection string

2006-08-19 Thread Michael Meskes
On Fri, Aug 18, 2006 at 02:54:19PM -0600, Michael Fuhr wrote: It works with a double-quoted string but not with a single-quoted string as the documentation mentions. It's not supposed to work with single-quoted strings. This is a documentation bug. Or does anyone think we should support single

Re: [GENERAL] Arrays and backslashes

2006-08-19 Thread Tom Lane
Colin DuPlantis [EMAIL PROTECTED] writes: I am having trouble inserting a value into the array column that contains a single '\' (no quotes) character. The following examples are my attempts to produce a value of 'x\y' (no quotes) in both the regular text and the text array columns in the

Re: [GENERAL] Connection string

2006-08-19 Thread Michael Fuhr
On Sat, Aug 19, 2006 at 03:36:42PM +0200, Michael Meskes wrote: On Fri, Aug 18, 2006 at 02:54:19PM -0600, Michael Fuhr wrote: It works with a double-quoted string but not with a single-quoted string as the documentation mentions. It's not supposed to work with single-quoted strings. This

Re: [GENERAL] Cast null string '' to integer 0

2006-08-19 Thread Bruce Momjian
Dwight Emmons wrote: I am upgrading from Postgres 7.2 to 8.1. We have multiple systems already in place that took advantage of the implicit cast of a null '' string to an integer of '0'. It is not financially feasible for us to modify all the instances. Does anyone know of a fix? You would

Re: [GENERAL] problem with postgres SQL db

2006-08-19 Thread Andrew Sullivan
On Thu, Aug 17, 2006 at 10:52:24PM +0200, Rodion Raskolnikov wrote: now i dont remember SYNTAX what we use when we export db. You need to use the _latest_ pg_dump. If you used the 7.2 pg_dump, it for sure won't work. There are functional changes between 7.2 and 8.1 that might make this

[GENERAL] text formatting in a query, a la sprintf

2006-08-19 Thread Reece Hart
I often desire text and number formatting that's not available with functions like to_char. I'd really like to have functionality akin to sprintf, such as: $ select no_hits,term,sprintf('http://google.com?q=%s',replace(queryterm,' ','+')) as url from queries; $ select

[GENERAL] Locale, encoding, sort order confusion

2006-08-19 Thread John Gunther
I've been reading about locales, encodings, sort orders, the to_ascii function and, embarrasingly, I'm more confused than enlightened.: What I want is very simple: 1) I want the database to correctly accept, store, and display alphabetic characters, including European accented characters,

[GENERAL] Locale, encoding, sort order confusion

2006-08-19 Thread John Gunther
I've been reading about locales, encodings, sort orders, the to_ascii function but I'm more confused than enlightened. What I want is very simple: 1) I want the database to correctly accept, store, and display alphabetic characters, including European accented characters, entered and viewed in

Re: [GENERAL] Cast null string '' to integer 0

2006-08-19 Thread Guy Rouillier
Dwight Emmons wrote: I am upgrading from Postgres 7.2 to 8.1. We have multiple systems already in place that took advantage of the implicit cast of a null '' string to an integer of '0'. It is not financially feasible for us to modify all the instances. Does anyone know of a fix? Well,

Re: [GENERAL] text formatting in a query, a la sprintf

2006-08-19 Thread Michael Fuhr
On Sat, Aug 19, 2006 at 01:59:17PM -0700, Reece Hart wrote: I often desire text and number formatting that's not available with functions like to_char. I'd really like to have functionality akin to sprintf, such as: $ select no_hits,term,sprintf('http://google.com?q=% s',replace(queryterm,'

Re: [GENERAL] count and limit

2006-08-19 Thread Fabio Victora Hecht
Ok, so I think the best that can be done is to EXPLAIN the query and check if it's gonna take long. If it is, I could use the estimated count. Thanks, FabioOn 8/17/06, Chris [EMAIL PROTECTED] wrote: Michael Fuhr wrote: On Fri, Aug 18, 2006 at 10:34:44AM +1000, Chris wrote: Fabio Victora Hecht

Re: [GENERAL] Cast null string '' to integer 0

2006-08-19 Thread Berend Tober
Guy Rouillier wrote: Dwight Emmons wrote: I am upgrading from Postgres 7.2 to 8.1. We have multiple systems already in place that took advantage of the implicit cast of a null '' string to an integer of '0'. It is not financially feasible for us to modify all the instances. Does anyone