[GENERAL] Overwriting Operator for numeric and float8 fails

2001-08-19 Thread Johann Zuschlag

Hi,

My application does queries like this:

SELECT t6.* FROM RECHNUNG  t6 WHERE t6.bruttosumm = 0034.70 ORDER BY t6.nummer DESC

I get the following error: Unable to identify an operator '=' for types 'numeric' and 
'float8'...
and of course the same for the operator ''. 
Ok, ok quotes missing.

Before I just let the ODBC-driver patch the quotes. Not so smart.
Now I tried the smarter way by overwriting the operator:

create function numeric_eq(numeric,float8) 
returns bool 
as '' 
language 'internal'; 

create operator = (
leftarg=numeric,
rightarg=float8,
procedure=numeric_eq,
commutator='=',
negator='',
restrict=eqsel,
join=eqjoinsel
);

The Problem is: It doesn't work and the backend process crashes and get's restarted.
I tried it with 7.03 and I guess 7.1.3 behaves the same.
What am I doing wrong? Can somebody give me a hint?

Thanks in advance



Johann Zuschlag
[EMAIL PROTECTED]



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])



Re: [GENERAL] Overwriting Operator for numeric and float8 fails

2001-08-19 Thread Andrew Gould

I think you have a syntax error in the SELECT
statement.  What is RECHNUNG? The only table reference
that I see is t6.

If RECHNUNG is the database, connect to the database
and try:

Select * from t6 where bruttosum = 0034.70
order by nummer desc;

Best of luck,

Andrew Gould

--- Johann Zuschlag [EMAIL PROTECTED] wrote:
 Hi,
 
 My application does queries like this:
 
 SELECT t6.* FROM RECHNUNG  t6 WHERE t6.bruttosumm =
 0034.70 ORDER BY t6.nummer DESC
 
 I get the following error: Unable to identify an
 operator '=' for types 'numeric' and 'float8'...
 and of course the same for the operator ''. 
 Ok, ok quotes missing.
 
 Before I just let the ODBC-driver patch the quotes.
 Not so smart.
 Now I tried the smarter way by overwriting the
 operator:
 
 create function numeric_eq(numeric,float8) 
 returns bool 
 as '' 
 language 'internal'; 
 
 create operator = (
 leftarg=numeric,
 rightarg=float8,
 procedure=numeric_eq,
 commutator='=',
 negator='',
 restrict=eqsel,
 join=eqjoinsel
 );
 
 The Problem is: It doesn't work and the backend
 process crashes and get's restarted.
 I tried it with 7.03 and I guess 7.1.3 behaves the
 same.
 What am I doing wrong? Can somebody give me a hint?
 
 Thanks in advance
 
 
 
 Johann Zuschlag
 [EMAIL PROTECTED]
 
 
 
 ---(end of
 broadcast)---
 TIP 2: you can get off all lists at once with the
 unregister command
 (send unregister YourEmailAddressHere to
[EMAIL PROTECTED])


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [GENERAL] Serial not so unique?

2001-08-19 Thread Tom Lane

Stephen Robert Norris [EMAIL PROTECTED] writes:
 ... The test case that
 demonstrates it sometimes takes about 1.5 hours to run,

If you have a reproducible test case, let's see it.  Bulk isn't as
important as being able to get the behavior under a microscope...

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])



[GENERAL] is this possible? it should be!

2001-08-19 Thread newsreader

Hello

I have statements (highly simplified just to get
the point across) like

select a,b,c from a where d=2 order by e limit 10;

Now I think that because of order by the above query
already knows the result of the below query

select count(*) from a where d=2;

The point is that I want to know the total number
of matches and I also want to use limit.  And
I don't want to do two queries.

If it's impossible I would like to know whether
it costs the same to PG if I use it with or
without limit.

If I use DBI and simplified queries look like

$s=$dbh-prepare('select a,b,c from a where d=2 order by e ');
$s-execute();

I get the total number of rows by

$n=$s-rows;

I then use perl to implement limit

Thanks in advance for any hints


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[GENERAL] OT: Design Books

2001-08-19 Thread David Wheeler

Hey All,

I'm looking for a couple of solid books to help me broaden my knowledge of
database design so that I can improve my designs. So what do you like?
What stuff have you read and would recommend? I'm most interested in
fundamentals of both standard relational database design and object
database design. Anything with a PostgreSQL emphasis is an added bonus ;-)

TIA!

David

-- 
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
   Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] OT: Design Books

2001-08-19 Thread Sam Tregar

On Sun, 19 Aug 2001, David Wheeler wrote:

 I'm looking for a couple of solid books to help me broaden my knowledge of
 database design so that I can improve my designs. So what do you like?
 What stuff have you read and would recommend? I'm most interested in
 fundamentals of both standard relational database design and object
 database design. Anything with a PostgreSQL emphasis is an added bonus ;-)

Hey David!  Any book with a clear description of normal forms is useful.
One I remember as being decent was A First Course in Database Systems
(0138613370).  Also useful is a good book on UML, which I've found is
invaluable for database design.  For this The Unified Modeling Language
User Guide (0201571684) is good.

-sam



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])



[GENERAL] chr() in 7.0.3 !

2001-08-19 Thread omid omoomi

hi all,
I have pg 7.0.3 installed. I can use ascii() to get the ascii code of a 
character but I can not use chr() to reverse the function... is it a matter 
of the pg version I have? If so, is there any other way to get the text from 
the ascii number?

TIA
Omid Omoomi

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])



Re: [GENERAL] OT: Design Books

2001-08-19 Thread omid omoomi

Hi,
The one I recommend is:

Introduction to System Analysis and Design
by Igor Hawryszkiewycz
ISBN 013 896887 X

Hope that helped
Omid Omoomi

From: David Wheeler [EMAIL PROTECTED]
To: PostgreSQL-general [EMAIL PROTECTED]
Subject: [GENERAL] OT: Design Books
Date: Sun, 19 Aug 2001 11:48:57 -0700 (PDT)

Hey All,

I'm looking for a couple of solid books to help me broaden my knowledge of
database design so that I can improve my designs. So what do you like?
What stuff have you read and would recommend? I'm most interested in
fundamentals of both standard relational database design and object
database design. Anything with a PostgreSQL emphasis is an added bonus ;-)

TIA!

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
Yahoo!: dew7e
Jabber: 
[EMAIL PROTECTED]


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[GENERAL] Re: chr() in 7.0.3 !

2001-08-19 Thread Lee Harr

On Sun, 19 Aug 2001 20:59:35 + (UTC), omid omoomi [EMAIL PROTECTED]:
 hi all,
 I have pg 7.0.3 installed. I can use ascii() to get the ascii code of a 
 character but I can not use chr() to reverse the function... is it a matter 
 of the pg version I have? If so, is there any other way to get the text from 
 the ascii number?

Hmm.. works in 7.1.2:

select chr(65);

 chr
-
 A
(1 row)


Have you tried it like that (selecting a constant?) Maybe it is
a problem with coercing the argument to the proper type...

Could also be new in 7.1  I do not know.


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[GENERAL] New RPMS ?

2001-08-19 Thread Fernando Lozano

Hi there!

Are there plans for 7.1.3 RPMS for Red Hat 6.2 and other systems using
the older glibc and rpm format?


[]s, Fernando Lozano


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [GENERAL] Serial not so unique?

2001-08-19 Thread Michael Samuel

I encountered the same problem.  The machine it happenned on _may_ have had
a power outage before I noticed the problem. (I know it had one a while back
when on the workbench, but I can't remember if that was before or after I'd
setup the tables)

BTW, this was a debian box, running the 7.1release-4 package.

On Sat, Aug 18, 2001 at 03:55:28PM +1000, Stephen Robert Norris wrote:
 We have a table here with a serial value in it.
 
 We have sets of test data that we run through a processor that changes
 a fairly large set of tables in deterministic ways.
 
 Sometimes (about 20%, it seems) with several of the data sets, we
 get an error trying to insert rows into the table with the serial in it.
 On investigation, it seems that the serial number has got to 101, then
 set itself back to 4, causing nextval to return 5, and there are already
 entries from 1-101.
 
 Now, we use the serial as the primary key, and we never explicitly set it.
 
 Has anyone seen anything like this? I can work around it by generating
 a serial number within the application, but that's not ideal.
 
 Is this another RTFM question?
 
   Stephen
 
 ---(end of broadcast)---
 TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly
 

-- 
Michael Samuel
Tech Guy

[EMAIL PROTECTED]

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Hyperlink, a division of The Swish Group Ltd
ACN 085 545 973
Level 6, 257 Collins St, Melbourne, VIC 3004
Phone 1300 368 638 Fax +61 3 9211 5406
http://www.hyperlink.net.au
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [GENERAL] New RPMS ?

2001-08-19 Thread Trond Eivind Glomsrød

Fernando Lozano [EMAIL PROTECTED] writes:

 Are there plans for 7.1.3 RPMS for Red Hat 6.2 and other systems using
 the older glibc and rpm format?

FWIW, while a version for RHL 6.2 makes sense because of glibc issues
(and other libraries), the supported rpm format for RHL 6.2 is v4.
Erratas (you have applied those, right? ;) also come in that format.

-- 
Trond Eivind Glomsrød
Red Hat, Inc.

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])