Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 25th, 2002, 07:20 AM
Zitan Zitan is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2001
Location: New Zealand
Posts: 638 Zitan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 10 sec
Reputation Power: 8
PostgreSQL vs M$ SQL

Sorry to start another one of these threads -lol , but I want to convince a client that postgresql provides a better solution than M$ SQL

My main question is I know that the stored procedure language in postgreSQL is a copy of Oracle PL/SQL. How good is MS SQL PL/SQL? I was hoping that it wasn't as good as PostgreSQL.

We (well actually our DBA ) try to move all a system's business logic into the database whichs provides better security and speed. Because of this we need a powerful PL/SQL coding language

If there any other compelling reasons I'd be interested.

Awesome and thanks,

Z.

Reply With Quote
  #2  
Old September 25th, 2002, 09:28 AM
MattR MattR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: High above the mucky-muck (Columbus, OH)
Posts: 266 MattR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to MattR
PL/SQL is Oracle's made-up procedural SQL language. T-SQL is Microsoft's and Sybase's.

Reply With Quote
  #3  
Old September 25th, 2002, 09:34 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 43
Well, SQL Server is one of the better of Microsoft's products, so this isn't an easy, clear-cut decision. I would say there are pros and cons, and one should think through needs carefully. PostgreSQL definitely has technical excellence and good programming techniques. It will definitely perform much better on low to midrange hardware. MSSQL, I would say has a few technical problems, but it does have some of the more "enterprise" features, such as clustering, full replication, etc... as well as better integration with other Microsoft products.

If I had to program a Microsoft Access front end to a company DB, I would probably choose SQL Server, for example, but if I had to provide DB access to a heterogenous range of systems, with different hardware, OS, and software, then I would tend to choose PostgreSQL. Also, PostgreSQL offers some nice scientific-minded extra capabilities, which you can read about in some of my other posts in this forum and the PostgreSQL forum.

PostgreSQL actually offers the capability to handle stored procedures in 5 languages, with the possibility of a 6th coming soon:

- SQL
- PL/PgSQL
- Perl (this is great for complex logic!)
- Python
- TCL (can actually connect to front-end GUIS)
- Java (coming soon...)
__________________
The real n-tier system:

FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

Amazon wishlist -- rycamor (at) gmail.com

Reply With Quote
  #4  
Old September 25th, 2002, 07:57 PM
Zitan Zitan is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2001
Location: New Zealand
Posts: 638 Zitan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 10 sec
Reputation Power: 8
Thanks that makes excellent reading I really appreciate the responses and the advice. Now back to that RFI - LOL

Z.

Reply With Quote
  #5  
Old September 25th, 2002, 10:21 PM
snelo snelo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 3 snelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

I recently had the same problem ... Client has 50+ users - I showed him how much he'd pay for a M$ SQL server

Reply With Quote
  #6  
Old September 26th, 2002, 12:47 PM
Zitan Zitan is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2001
Location: New Zealand
Posts: 638 Zitan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 10 sec
Reputation Power: 8
Off the top of your head can I ask how much that was (and in what currency) ? How much approx for 100 users ?

Its 5:45AM and I'm grasping at straws - lol.

Thanx,
Z.

Reply With Quote
  #7  
Old September 26th, 2002, 05:21 PM
snelo snelo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 3 snelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cost depends on how what your current config is...
Assuming you already have a NT/2000 Server licence that you can use and sufficent Client Access Licenses for it (this assumes that you are going to be accessing the data via a direct ODBC connection or something like that - rather than via a web-page (PHP/ASP etc) (which is the situation for my client - we have a MS Access front end that is being ported to a SQL backend (PostgreSQL))

MS SQL Server 2000 Server with 10 Client Access licences RRP ~$A5,000
MS SQL Server 2000 Client Access Licences ~$A200
gets nasty quick...

One gotcha I've gotten with PostgreSQL however is the inability to switch off case-sensitivity ... My major app is a call centre and if one operator types 'Smith' and another types 'smith' ... the simple query
SELECT * FROM tblContact WHERE LastName = 'smith';
will not match 'Smith'

One thing that PostgreSQL will do which I believe M$SQL won't is partial indexes ... that is, if you have data where 80% of the data is the same and only 20% varies - you can create an index on the 20% so you *can* speed up queries on the 20%

Reply With Quote
  #8  
Old September 26th, 2002, 05:50 PM
Zitan Zitan is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2001
Location: New Zealand
Posts: 638 Zitan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 10 sec
Reputation Power: 8
So for 100 client access users that is $50,000? However once you've got M$, what is the cost of setting up a new server with the same clients?

Thanks dude,

G.

Reply With Quote
  #9  
Old September 26th, 2002, 07:41 PM
donarb donarb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 1999
Location: Seattle
Posts: 133 donarb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
One gotcha I've gotten with PostgreSQL however is the inability to switch off case-sensitivity

You can just use regular expression matching:

SELECT * FROM tblContact WHERE LastName ~* 'smith';

This will match 'sMiTh', 'SMith' and all other variations.

And PostgreSQL also allows you to override the meaning of operators, so you could redefine the '=' to be case insensitive when comparing strings.

Don

Reply With Quote
  #10  
Old September 26th, 2002, 08:58 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 43
Quote:
Originally posted by donarb

SELECT * FROM tblContact WHERE LastName ~* 'smith';
I think performance isn't so great with regex queries. For this situation, its better to just use the case-insensitive version of the LIKE operator: ILIKE
Code:
SELECT * FROM tblContact WHERE LastName ILIKE 'smith';
This more portable SQL, and is also good for partial matches, such as with 'smith%', etc...

Reply With Quote
  #11  
Old September 26th, 2002, 09:32 PM
snelo snelo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 3 snelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Getting around case sensitivity
I read an article about putting an index on a lower-case version of the field - which speeds up the search and it suggested putting
SELECT * FROM tblContact WHERE Lower(LastName) = 'smith'

I have the added complication that I am using an ODBC link in and for various things I'm not wanting to write pass-thru queries - which would rule out regex.

However I'm guessing if you want to use a regex and get some performance out of it (ie provided you have and index on the field) if you use

SELECT * FROM tblContact WHERE LastName ~* '^smith$'

You of course could leave off the $ but that would then match last names beginning with smith eg Smithson - and if you have a lot of names it mightn't use the index ... I suggest using EXPLAIN on your query and then you can play around to get performance.

BACK To the question of M$SQL vs PostgreSQL... if you already have MS SQL and/or the licensing costs arn't an issue. Then depending on the front-end eg Suppose you're using MS Access - you may find the migration to M$SQL easier!!!

Also, I know that M$SQL is quite good at replicating (ie running a DB over 2 sites) haven't found any comments - re Is it possible, or its possible but painful, or it is a no-brainer to have 2 psql db's in sync (assuming you're updating both sides - if you only make changes on one db ... making the copy is a no-brainer (pg_dump))

Reply With Quote
  #12  
Old August 18th, 2003, 02:49 PM
ssachs ssachs is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Cambridge, MA
Posts: 1 ssachs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to ssachs
numerical comparisons of PostgreSQL and MS SQL Server

Has anyone seen a numerical comparison of PostgreSQL and MS SQL Server? It would be very helpful.

Thanks,
Shai Sachs

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > PostgreSQL vs M$ SQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |