[SQL] Unable to identify a right operator '>=' for type 'bpchar'

2000-05-24 Thread Michael Ma
Hi, While running the following SQL statement in postgresql-7.0-1 via JDBC, select a.cus_code, a.dlv_code, b.cus_abbr, a.dlv_abbr, a.address, a.tel, a.fax, a.contact from dlv_point a, customer b where ((a.cus_code >= ? and a.cus_code <= ?) or (b.cus_abbr >= ? and

Re: [SQL] Unable to identify a right operator '>=' for type 'bpchar'

2000-05-24 Thread Tom Lane
Michael Ma <[EMAIL PROTECTED]> writes: > While running the following SQL statement in postgresql-7.0-1 via > JDBC, >select a.cus_code, a.dlv_code, b.cus_abbr, a.dlv_abbr, > a.address, a.tel, a.fax, a.contact > from dlv_point a, customer b > where ((a.cus_code >= ? and a.cus

[SQL] Why is PostgreSQL 7.0 SQL semantics different from Oracle's?

2000-05-24 Thread Thomas Holmgren
Hello everyone! :) This little problem is bothering me a lot! It seems that PostgreSQL 7.0 uses different semantics than Oracle when evaluting SQL?! I have two relations, A and B, both containing the attributes "number" (int) and "amount" (int). There's no primary key, and the two relations can

Re: [SQL] Unable to identify a right operator '>=' for type 'bpchar' (solved)

2000-05-24 Thread Michael Ma
It is solved and closed now. Thanks

[SQL] Why is PostgreSQL 7.0 SQL semantics different from Oracle's?

2000-05-24 Thread Thomas Holmgren
Hello everyone! :) This little problem is bothering me a lot! It seems that PostgreSQL 7.0 uses different semantics than Oracle when evaluting SQL?! I have two relations, A and B, both containing the attributes "number" (int) and "amount" (int). There's no primary key, and the two relations ca

[SQL] Re: Automatic index numbers

2000-05-24 Thread Kees Kuip
Daniel Mendyke wrote: > > How can I automatically create a unique index > number when I add new data to a table? > Try CREATE TABLE test ( id serial )

[SQL]

2000-05-24 Thread gomathi raju
Hi friends, I want to get the system timestamp from postgresql database. But I dont have a dual table from where ,I can select it. Give me a solution, from which table(system) I can get it. Regards, gomathi Get free email and

[SQL] possible bug with group by?

2000-05-24 Thread Joseph Shraibman
Is this a bug or am I just misunderstanding something? playpen=> create table tablea ( a int,b int , c int ); CREATE playpen=> insert into tablea(a, b) values (1 ,2); INSERT 28299 1 playpen=> insert into tablea(a, b, c) values (2 ,3, 4); INSERT 28300 1 playpen=> select a, b, case when c is null t

[SQL] Clarified Question

2000-05-24 Thread Kyle Bateman
  How can I create a function that will take in two variables and return an integer, when one of the variables is the tablename ?! I have tried :     create function tst_func(text, varchar(16))     as     'BEGIN     result=select max(histor

Re: [SQL] Why is PostgreSQL 7.0 SQL semantics different from Oracle's?

2000-05-24 Thread Jan Wieck
Thomas Holmgren wrote: > > Hello everyone! :) > > This little problem is bothering me a lot! It seems that PostgreSQL 7.0 > uses different semantics than Oracle when evaluting SQL?! Not that much, but ... > [...] > > I have defined two views, viewA and viewB. They are defined as follow: > >

Re: [SQL] possible bug with group by?

2000-05-24 Thread Julie Hunt
Joseph Shraibman wrote: > > > playpen=> select a, b, case when c is null then 'not set' else 'set' end > as z from tablea group by a, b, z; > ERROR: Unable to identify an operator '<' for types 'unknown' and > 'unknown' > You will have to retype this query using an explicit cast > play

Re: [SQL] possible bug with group by?

2000-05-24 Thread Ross J. Reedstrom
On Wed, May 24, 2000 at 06:30:49PM -0400, Joseph Shraibman wrote: > Is this a bug or am I just misunderstanding something? > Not a bug, pgsql is just less willing to cast things willy-nilly in 7.0 than it was in 6.x. In this case, the system doesn't know what 'not set' and 'set' are supposed to

[SQL] Use of index in 7.0 vs 6.5

2000-05-24 Thread Ryan Bradetich
Tom (Or anyone else who is good with PostgreSQL statistics), I am in the process of transitioning from postgreSQL 6.5.3 to postgreSQL 7.0. I ran into an issue where a sequential scan is being choosen on postgreSQL 7.0 where an index scan was choosen on postgreSQL 6.5.3. Note: All tables have be

Re: [SQL] possible bug with group by?

2000-05-24 Thread Stephan Szabo
> Is this a bug or am I just misunderstanding something? > > playpen=> create table tablea ( a int,b int , c int ); > CREATE > playpen=> insert into tablea(a, b) values (1 ,2); > INSERT 28299 1 > playpen=> insert into tablea(a, b, c) values (2 ,3, 4); > INSERT 28300 1 > playpen=> select a, b, case

Re: [SQL] possible bug with group by?

2000-05-24 Thread Tom Lane
Joseph Shraibman <[EMAIL PROTECTED]> writes: > playpen=> select a, b, case when c is null then 'not set' else 'set' end > as z from tablea group by a, b, z; > ERROR: Unable to identify an operator '<' for types 'unknown' and 'unknown' > You will have to retype this query using an explicit

Re: [SQL] possible bug with group by?

2000-05-24 Thread Joseph Shraibman
Julie Hunt wrote: > > Joseph Shraibman wrote: > > > > > > > playpen=> select a, b, case when c is null then 'not set' else 'set' end > > as z from tablea group by a, b, z; > > ERROR: Unable to identify an operator '<' for types 'unknown' and > > 'unknown' > > You will have to retype thi

Re: [SQL] possible bug with group by?

2000-05-24 Thread Joseph Shraibman
Stephan Szabo wrote: > > > Is this a bug or am I just misunderstanding something? > > > > playpen=> create table tablea ( a int,b int , c int ); > > CREATE > > playpen=> insert into tablea(a, b) values (1 ,2); > > INSERT 28299 1 > > playpen=> insert into tablea(a, b, c) values (2 ,3, 4); > > INSE

Re: [SQL] possible bug with group by?

2000-05-24 Thread Tom Lane
Joseph Shraibman <[EMAIL PROTECTED]> writes: > But why would group by need to sort it? To insert it into a tree to > make lookups of distinct values faster? No, to bring identical values together. GROUP BY and DISTINCT are both implemented as basically a "sort | uniq" pipeline.

Re: [SQL] Use of index in 7.0 vs 6.5

2000-05-24 Thread Tom Lane
Ryan Bradetich <[EMAIL PROTECTED]> writes: > I am in the process of transitioning from postgreSQL 6.5.3 to > postgreSQL 7.0. I ran into an issue where a sequential scan > is being choosen on postgreSQL 7.0 where an index scan was > choosen on postgreSQL 6.5.3. Since you're complaining, I assume

Re: [SQL] Use of index in 7.0 vs 6.5

2000-05-24 Thread Ryan Bradetich
Tom Lane wrote: > Ryan Bradetich <[EMAIL PROTECTED]> writes: > > I am in the process of transitioning from postgreSQL 6.5.3 to > > postgreSQL 7.0. I ran into an issue where a sequential scan > > is being choosen on postgreSQL 7.0 where an index scan was > > choosen on postgreSQL 6.5.3. > > Since

Re: [SQL] Use of index in 7.0 vs 6.5

2000-05-24 Thread Tom Lane
Ryan Bradetich <[EMAIL PROTECTED]> writes: > procman=# explain select count(catagory) from medusa where host_id = 404 > and catagory like 'A%'; > Here is my analysis of the stastics (based on the examples in the > archive). > The most common value host_id in the table is 446 with row fraction of