[SQL] Too many rows returning

2001-05-30 Thread Linh Luong
Hi, Does the number of rows affect how long it takes to execute a query. I have 3 UNIONS. One table has 97 rows, another has 7375 rows, and 1558; In each union there are at least one LEFT OUTER JOIN and each subselect has at least 2 JOINed tables. Something like this: select ..,..,,...,

Re: [SQL] Unique record Identifier?

2001-05-30 Thread Chris Ruprecht
on 05/30/2001 16:33, Josh Berkus at [EMAIL PROTECTED] wrote: > Chris, > Thanks Josh - that was my next step. At the moment, the database is not in production, I'm running a Progress database there, but I'm trying to learn the dos and don'ts in PG. I don't really need to backfill the records, I

[SQL] Using indexes

2001-05-30 Thread Linh Luong
Hi, Indexes are used to find a record faster in a table. It only seems to work if I am working with one table. eg) > create index customer_id_idx on customer(id); > select * from customer where id=1; -- This uses the index I create However, when I start to join 2 or more tables together it doe

Re: [SQL] Unique record Identifier?

2001-05-30 Thread Josh Berkus
Chris, > I'm busy writing an application using PostGreSQL and PHP, so my db > reads are > 'stateless' and I don't know at record 'write' time which record I > have read > to begin with. The records I have, have an index, most tables do have > a > unique index but the index values could get change

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Tom Lane
Mark <[EMAIL PROTECTED]> writes: > Even the postgresql documentation asserts something similar to this: You're reading obsolete documentation. There is no such assertion (as far as I can find, anyway) in the 7.1 documentation. The speed advantage of bpchar --- which was always extremely margina

[SQL] Unique record Identifier?

2001-05-30 Thread Chris Ruprecht
Hi all, I'm busy writing an application using PostGreSQL and PHP, so my db reads are 'stateless' and I don't know at record 'write' time which record I have read to begin with. The records I have, have an index, most tables do have a unique index but the index values could get changed during an u

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Mark
On 30 May 2001 12:53:22 -0400, Tom Lane wrote: > > You are operating under misinformation about what's efficient or not. > There are no performance penalties that I know of for varchar ... if > anything, bpchar is the less efficient choice, at least in Postgres. > The extra I/O costs for those

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Stephan Szabo
On 30 May 2001, Mark wrote: > On 30 May 2001 11:16:35 -0700, Stephan Szabo wrote: > > On Wed, 30 May 2001, Tom Lane wrote: > > > > > Mark <[EMAIL PROTECTED]> writes: > > > > It appears that the behavior of a bpchar compare with a string literal > > > > is not implicitly trimming the bpchar befo

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Mark
On 30 May 2001 11:16:35 -0700, Stephan Szabo wrote: > On Wed, 30 May 2001, Tom Lane wrote: > > > Mark <[EMAIL PROTECTED]> writes: > > > It appears that the behavior of a bpchar compare with a string literal > > > is not implicitly trimming the bpchar before the compare, which IMHO is > > > incorr

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Stephan Szabo
On Wed, 30 May 2001, Tom Lane wrote: > Mark <[EMAIL PROTECTED]> writes: > > It appears that the behavior of a bpchar compare with a string literal > > is not implicitly trimming the bpchar before the compare, which IMHO is > > incorrect behavior. Is my opinion valid? > > regression=# create tab

RE: [SQL] primary key scans in sequence

2001-05-30 Thread Stephan Szabo
On Wed, 30 May 2001, Koen Antonissen wrote: > Now this one doesn't: > Table "teams" > Attribute | Type | Modifier > ---+-+-- > id| integer | not null

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Tom Lane
Mark <[EMAIL PROTECTED]> writes: > It appears that the behavior of a bpchar compare with a string literal > is not implicitly trimming the bpchar before the compare, which IMHO is > incorrect behavior. Is my opinion valid? regression=# create table foo (f1 char(20)); CREATE regression=# insert i

[SQL] SELECT * INTO TABLE is not working for me.

2001-05-30 Thread Roy Souther
I am testing my SQL commands in pgaccess before I put them into my C++ code. Trying to copy a table using... SELECT * INTO TABLE copy_stuff FROM the_stuff It creates the view but no table called copy_stuff exists after I run it. Why? I can use... CREATE TABLE copy_stuff AS SELECT * FROM the_stuff

RE: [SQL] primary key scans in sequence

2001-05-30 Thread Koen Antonissen
I have the same problem, my primary key is defined as a serial though. Other tables use tables are defined as serials as well, but DO use Index Scans some tables do, some tables don't, even when creating 'my own' index on the primary key, it still uses sequencial scans! This one works fine:

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread [EMAIL PROTECTED]
I use a few of them, and in my opinion there is a distinct group of characters at last in the 8859-1 character set which have a lower and upper case instance. The ranges are 0xC0 to 0xDD for upper case and 0xE0 to 0xFD for upper (with the exception of 0xD0, 0xD7, 0xF0, and 0xF7). I haven't examin

bpchar compares (was Re: [SQL] Case Insensitive Queries)

2001-05-30 Thread Mark
It appears that the behavior of a bpchar compare with a string literal is not implicitly trimming the bpchar before the compare, which IMHO is incorrect behavior. Is my opinion valid? If so, how difficult of a fix would this be in terms of time and effort? Should I submit a bug report to anothe

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Mark
It appears that the behavior of a bpchar compare with a string literal is not implicitly trimming the bpchar before the compare, which IMHO is incorrect behavior. Is my opinion valid? If so, how difficult of a fix would this be in terms of time and effort? Should I submit a bug report to anothe

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Mark
It appears that the behavior of a bpchar compare with a string literal is not implicitly trimming the bpchar before the compare, which IMHO is incorrect behavior. Is my opinion valid? If so, how difficult of a fix would this be in terms of time and effort? Should I submit a bug report to anothe

Re: [SQL] ERROR: Class '37632' not found

2001-05-30 Thread Tom Lane
=?iso-8859-1?Q?DI_Hasen=F6hrl?= <[EMAIL PROTECTED]> writes: > When I want to create a rule *r_name*, I get the message, that this rule st= > ill exists and when I want to drop my rule *r_name*, I get the message: Cla= > ss '37632' not found Curious. That seems to indicate that the table the old

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread Tom Lane
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > If upper() and lower() operate on characters in 8859-1 and other character > sets when the appropriate locale is set, then a difference in the behavior > of upper() and lower() would seem like a bug. Au contraire ... upper() and lower() are not sy

[SQL] ERROR: Class '37632' not found

2001-05-30 Thread DI Hasenöhrl
Hello,   I have a problem to drop a rule from my database.   When I want to create a rule *r_name*, I get the message, that this rule still exists and when I want to drop my rule *r_name*, I get the message: Class '37632' not found   Please, can anyone help me to solve this problem. Thanks i

Re: [SQL] Left Joins...

2001-05-30 Thread Renato De Giovanni
> I've got a nasty query that joins a table onto itself like 22 times. > I'm wondering if there might be a better way to do this, and also how > I can left join every additional table on the first one. By this I > mean that if f1 matches my criteria and therefore isn't null, then > every other joi

Re: [SQL] Difficult SQL Statement

2001-05-30 Thread Renato De Giovanni
> I have a table that has the following columns: AUTHOR_NO, ASMT_CODE, & > STATUS. The table would look something like this: > AUTHOR_NO ASMT_CODE STATUS > 12345 1 PASSED > 12345 2 FAILED > 12345 3 FAILED > 12345 4 PASSED > 12346 1 PASSED > 1234

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread [EMAIL PROTECTED]
Can you please explain in little more detail? I am curious. I haven't noticed any discussion about upper() being different from lower() when it comes to such comparisons. As far as I know, upper() and lower() only operate on ascii characters a-z. If you are using the default locale, neither func