Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Michael Glaesemann
On Nov 25, 2005, at 16:43 , Christopher Kings-Lynne wrote: Yeah, I saw your commit. Nice shortcut. Also didn't know you could define operators using SQL functions. Tom's suggestion of NOT (a DISTINCT FROM b) is really cool. Much cleaner in my opinion. I learn a lot from these lists :)

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Michael Glaesemann
On Nov 25, 2005, at 16:37 , Michael Glaesemann wrote: Tom's suggestion of NOT (a DISTINCT FROM b) is really cool. Even cooler if I spell it correctly: NOT (a IS DISTINCT FROM b) Michael Glaesemann grzm myrealbox com ---(end of broadcast)---

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Christopher Kings-Lynne
Yeah, I saw your commit. Nice shortcut. Also didn't know you could define operators using SQL functions. Tom's suggestion of NOT (a DISTINCT FROM b) is really cool. Much cleaner in my opinion. I learn a lot from these lists :) Needs to return 0 or 1 though. Chris

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Michael Glaesemann
On Nov 25, 2005, at 16:24 , Christopher Kings-Lynne wrote: when ($1 is null and $2 is not null) or ($1 is not null and $2 is null) then 0 That's the same as: when $1 is null != $2 is null then 0 Yeah, I saw your commit. Nice shortcut. Also didn't know you could define operato

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Christopher Kings-Lynne
when ($1 is null and $2 is not null) or ($1 is not null and $2 is null) then 0 That's the same as: when $1 is null != $2 is null then 0 Chris ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropri

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Qingqing Zhou
On Thu, 24 Nov 2005, Tom Lane wrote: > > I don't see those costing nearly as much as your results show > ... perhaps there's something platform-specific at work? > What I see, down to the 1% level, is > I can see your computer is really slow, so my theory is that since it is easy to hold a runni

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Dennis Bjorklund
On Thu, 24 Nov 2005, Tom Lane wrote: > NOT (x IS DISTINCT FROM y) would be the standard-compliant way of > spelling that. That's the sql99 way. In sql2003 (but not in pg) one can also do X IS NOT DISTINCT FROM y -- /Dennis Björklund ---(end of broadcast)

Re: [HACKERS] PL/php in pg_pltemplate

2005-11-24 Thread Olivier Thauvin
Le Jeudi 24 Novembre 2005 18:07, Peter Eisentraut a écrit : > Tom Lane wrote: > > I don't see any strong reason for enforcing that as policy, if the > > language maintainer wants an entry. (But is Alvaro the maintainer of > > pl/php?) My recollection is that we identified some pros and cons of >

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Qingqing Zhou
On Thu, 24 Nov 2005, Qingqing Zhou wrote: > > I may need to write some separate tests to see if this is what we should > pay for bus lock instruction. > Here I come up with a test program to see how spinlock costs: $/pgsql/src/backend/storage/lmgr#./a.out Spinlock pair(2648542) duration: 143.13

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Tom Lane
Qingqing Zhou <[EMAIL PROTECTED]> writes: > Yeah, understood. What I can't understand that in this case why it costs > so much -- without concurrency, the LWLock code path just invloves > spinlock_lock/unlock and serveral simple instructions? I don't see those costing nearly as much as your result

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Qingqing Zhou
On Thu, 24 Nov 2005, Greg Stark wrote: > > > You executed LWLock 2.6 million times in just under 300ms. If my math is right > that's about 115 nanoseconds per lock or about 300 cycles on a 2.6Ghz > processor. > > That sounds like a lot but it's about the right order of magnitude. Was this > on a

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Greg Stark
Qingqing Zhou <[EMAIL PROTECTED]> writes: > Yeah, understood. What I can't understand that in this case why it costs > so much -- without concurrency, the LWLock code path just invloves > spinlock_lock/unlock and serveral simple instructions? You executed LWLock 2.6 million times in just under 3

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > Does anyone know how I'd go about implementing the following MySQL > operator in PostgreSQL? NOT (x IS DISTINCT FROM y) would be the standard-compliant way of spelling that. regards, tom lane -

Re: [HACKERS] NULL safe equality operator

2005-11-24 Thread Michael Glaesemann
On Nov 25, 2005, at 11:17 , Christopher Kings-Lynne wrote: Hi guys, Does anyone know how I'd go about implementing the following MySQL operator in PostgreSQL? I'm sure you know how to implement this with a stored procedure. AFAICT, if you wanted to actually implement this as an operator,

[HACKERS] NULL safe equality operator

2005-11-24 Thread Christopher Kings-Lynne
Hi guys, Does anyone know how I'd go about implementing the following MySQL operator in PostgreSQL? --- NULL-safe equal. This operator performs an equality comparison like the = operator, but returns 1 rather than NULL if both operands are NULL, and 0 rather than NULL if one operand isNULL

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Qingqing Zhou
On Thu, 24 Nov 2005, Simon Riggs wrote: > > Maybe, maybe not. The whole system is designed around high levels of > concurrent access. If you know for certain you don't ever need that then > other systems are probably the right choice. Concurrency has a cost and > a benefit. If you measure the co

Re: [HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Simon Riggs
On Thu, 2005-11-24 at 13:25 -0500, Qingqing Zhou wrote: > I did some gprof on a simple "SELECT COUNT(*) FROM test" query on cvs tip. > > Linux josh.db 2.4.29-1 #2 Tue Jan 25 17:03:33 EST 2005 i686 unknown > gcc: 2.96 > gprof: 2.13.90.0.2 > ./configure --without-readline > > There are 260k or so r

[HACKERS] gprof SELECT COUNT(*) results

2005-11-24 Thread Qingqing Zhou
I did some gprof on a simple "SELECT COUNT(*) FROM test" query on cvs tip. Linux josh.db 2.4.29-1 #2 Tue Jan 25 17:03:33 EST 2005 i686 unknown gcc: 2.96 gprof: 2.13.90.0.2 ./configure --without-readline There are 260k or so records in table test(i int), about 1500 pages. I give a shared_buffers

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Darcy Buskermolen
On Thursday 24 November 2005 06:09, Peter Eisentraut wrote: > Simon Riggs wrote: > > I was unaware of this. I've looked at the release notes and searched > > the archives, but this doesn't seem to be mentioned by CVE number. > > (The vulnerabilities and their resolutions are described, just > > wit

Re: [HACKERS] PL/php in pg_pltemplate

2005-11-24 Thread Peter Eisentraut
Tom Lane wrote: > I don't see any strong reason for enforcing that as policy, if the > language maintainer wants an entry. (But is Alvaro the maintainer of > pl/php?) My recollection is that we identified some pros and cons of > having listings for non-core languages, and decided it should be up

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Tom Lane
"Andrew Dunstan" <[EMAIL PROTECTED]> writes: >> On Thu, 2005-11-24 at 15:09 +0100, Peter Eisentraut wrote: >>> We really should write the CVE numbers into the commit messages and >>> the release notes. > A security page on the web site that summarised the info would be good too. Not to mention a

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Andrew Dunstan
Simon Riggs said: > On Thu, 2005-11-24 at 15:09 +0100, Peter Eisentraut wrote: > >> We really should write the CVE numbers into the commit messages and >> the release notes. > > I think that would be good. > > A security page on the web site that summarised the info would be good too. cheers an

Re: [HACKERS] someone working to add merge?

2005-11-24 Thread Jan Wieck
On 11/24/2005 1:30 AM, Martijn van Oosterhout wrote: On Wed, Nov 23, 2005 at 04:55:25PM -0500, Jan Wieck wrote: The largest problem I see with MERGE is the question of BEFORE triggers. Consider a BEFORE INSERT trigger that modifies a third table, after which the constraint or whatever post-hea

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Simon Riggs
On Thu, 2005-11-24 at 15:09 +0100, Peter Eisentraut wrote: > We really should write the CVE numbers into the commit messages and the > release notes. I think that would be good. On Thu, 2005-11-24 at 12:35 +0100, Magnus Hagander wrote: > > > All known CVE problems are resolved in 8.0.4. > >

Re: [HACKERS] PL/php in pg_pltemplate

2005-11-24 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Alvaro Herrera wrote: >> Is anybody opposed to having PL/php in pg_pltemplate in the 8.1 >> branch? If not, I will add it on monday. (I plan to add it to 8.2 at >> the same time.) > pg_pltemplate should only be used for languages that are included in

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-24 Thread Pollard, Mike
If you're referring to my procedure for newid(), then it was just because of pure laziness; it was an internal proof of concept project, and I was still concentrating on getting it working. Mike Pollard SUPRA Server SQL Engineering and Support Cincom Systems, Inc.

Re: [HACKERS] NVL vs COALESCE

2005-11-24 Thread Pavel Stehule
When we're having an alias discussion, I'd really like to see NVL in postgres. Not because of porting from oracle as much as just spelling that without the reference manual is completely impossible. Best regards, Marcus You can found NVL in orafunc on pgfoundry. Regards Pavel Stehule

Re: [HACKERS] POWER vs. POW ???

2005-11-24 Thread Reinoud van Leeuwen
On Thu, Nov 24, 2005 at 08:00:21PM +0800, Christopher Kings-Lynne wrote: > How come these give slightly different results? > > test=# SELECT POW(2,-2); > pow > -- > 0.25 > (1 row) > > test=# SELECT POWER(2,-2); > power > --- > 0.25 > (1 row) > > > (Note width of result field.) The

Re: [HACKERS] [GENERAL] Private email requests

2005-11-24 Thread Harald Armin Massa
Bruce, list, I translated that part to german, I know the source is strong in Germany - maybe it can be a helpfull addition - even if most speak English, they are even more happy to read sth. in German. Harald  Due to time constraints, I do not directly answer general PostgreSQLquestions.  For a

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Peter Eisentraut
Simon Riggs wrote: > I was unaware of this. I've looked at the release notes and searched > the archives, but this doesn't seem to be mentioned by CVE number. > (The vulnerabilities and their resolutions are described, just > without direct cross reference to their CVE number.) We really should wr

Re: [HACKERS] PL/php in pg_pltemplate

2005-11-24 Thread Peter Eisentraut
Alvaro Herrera wrote: > Is anybody opposed to having PL/php in pg_pltemplate in the 8.1 > branch? If not, I will add it on monday. (I plan to add it to 8.2 at > the same time.) pg_pltemplate should only be used for languages that are included in the PostgreSQL source tree. -- Peter Eisentraut

Re: [HACKERS] NVL vs COALESCE

2005-11-24 Thread Christopher Kings-Lynne
If we're going to do that we should add IFNULL() from MySQL as well... Chris Michael Glaesemann wrote: On Nov 24, 2005, at 21:21 , Marcus Engene wrote: When we're having an alias discussion, I'd really like to see NVL in postgres. Not because of porting from oracle as much as just spelling

Re: [HACKERS] NVL vs COALESCE

2005-11-24 Thread Michael Glaesemann
On Nov 24, 2005, at 21:21 , Marcus Engene wrote: When we're having an alias discussion, I'd really like to see NVL in postgres. Not because of porting from oracle as much as just spelling that without the reference manual is completely impossible. NVL: what a very unfortunate spelling. (NU

[HACKERS] NVL vs COALESCE

2005-11-24 Thread Marcus Engene
When we're having an alias discussion, I'd really like to see NVL in postgres. Not because of porting from oracle as much as just spelling that without the reference manual is completely impossible. Best regards, Marcus ---(end of broadcast)---

Re: [HACKERS] POWER vs. POW ???

2005-11-24 Thread Christopher Kings-Lynne
It appears that the line is extended one underscore beyond the width of the wider of the attribute name and value. Am I missing something? Ah yes, I'm stupid :P Chris ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [HACKERS] POWER vs. POW ???

2005-11-24 Thread Christopher Kings-Lynne
Also, POW() is not documented here: http://www.postgresql.org/docs/8.1/interactive/functions-math.html Chris Christopher Kings-Lynne wrote: How come these give slightly different results? test=# SELECT POW(2,-2); pow -- 0.25 (1 row) test=# SELECT POWER(2,-2); power --- 0.25 (1 r

Re: [HACKERS] POWER vs. POW ???

2005-11-24 Thread D'Arcy J.M. Cain
On Thu, 24 Nov 2005 20:00:21 +0800 Christopher Kings-Lynne <[EMAIL PROTECTED]> wrote: > How come these give slightly different results? > > test=# SELECT POW(2,-2); > pow > -- > 0.25 > (1 row) > > test=# SELECT POWER(2,-2); > power > --- >0.25 > (1 row) > > > (Note width of re

[HACKERS] TRUNC vs. TRUNCATE

2005-11-24 Thread Christopher Kings-Lynne
Hi, I notice we added CEILING() as an alias to CEIL() for compatibility. We also have POWER() for POW(). I notice that MySQL uses TRUNCATE() and we only have TRUNC(). Is TRUNCATE actually spec compliant? Should we add TRUNCATE anyway for consistency and compatibility? Chris ---

Re: [HACKERS] POWER vs. POW ???

2005-11-24 Thread Michael Glaesemann
On Nov 24, 2005, at 21:00 , Christopher Kings-Lynne wrote: How come these give slightly different results? test=# SELECT POW(2,-2); pow -- 0.25 (1 row) test=# SELECT POWER(2,-2); power --- 0.25 (1 row) (Note width of result field.) It appears that the line is extended one und

[HACKERS] POWER vs. POW ???

2005-11-24 Thread Christopher Kings-Lynne
How come these give slightly different results? test=# SELECT POW(2,-2); pow -- 0.25 (1 row) test=# SELECT POWER(2,-2); power --- 0.25 (1 row) (Note width of result field.) Chris ---(end of broadcast)--- TIP 4: Have you searched ou

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Magnus Hagander
> > All known CVE problems are resolved in 8.0.4. > > I was unaware of this. I've looked at the release notes and > searched the archives, but this doesn't seem to be mentioned > by CVE number. (The vulnerabilities and their resolutions are > described, just without direct cross reference to th

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-24 Thread Christopher Kings-Lynne
Why do you use "GRANT ALL" and not "GRANT SELECT, UPDATE"? All means everybody can do bad things with those sequences. GRANT ALL on a sequence IS GRANT SELECT & UPDATE. Chris ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will

Re: [HACKERS] [BUGS] BUG #2052: Federal Agency Tech Hub Refuses to Accept

2005-11-24 Thread Simon Riggs
On Fri, 2005-11-18 at 09:32 -0500, Tom Lane wrote: > All known CVE problems are resolved in 8.0.4. I was unaware of this. I've looked at the release notes and searched the archives, but this doesn't seem to be mentioned by CVE number. (The vulnerabilities and their resolutions are described, just

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-24 Thread Mario Weilguni
Am Mittwoch, 23. November 2005 16:32 schrieb Pollard, Mike: > If this gets added as a contrib, here's a version of uniqueidentifier > and newid() I wrote that maintains the same format as the SQL Server > version: > > CREATE SCHEMA sqlserver > AUTHORIZATION postgres; > GRANT ALL ON SCHEMA sqlserv

Re: [HACKERS] MS SQL Server compatibility functions

2005-11-24 Thread Fredrik Olsson
Fredrik Olsson wrote: Devrim GUNDUZ wrote: Hi, On Wed, 23 Nov 2005, Fredrik Olsson wrote: I guess I am not the only one moving from MS SQL Server, so is there interest for others to use my work, as a contrib perhaps. And how should I continue from here in that case? I'd start a new proje

Re: [HACKERS] core dump on 8.1 and no dump on REL8_1_STABLE

2005-11-24 Thread Teodor Sigaev
initdb -E KOI8-R --locale ru_RU.KOI8-R -D $DIR In HEAD I get HEAD and REL8_1STABLE works fine, 8.1 release not (I don't test REL8_1_0, just take a source package) -- Teodor Sigaev E-mail: [EMAIL PROTECTED]