dbTalk Databases Forums  

Re: PostgreSQL

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Re: PostgreSQL in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DeJuan Jackson
 
Posts: n/a

Default Re: PostgreSQL - 07-01-2003 , 06:36 PM






Welcome to the light.

Ulisses Ponticelli Giorgi wrote:

Quote:
Hi,

I´m SQL Server 2000 user and want to migrate to PostgreSQL,
mainly because is the most suitable database to my needs (it is very
robust) and because the price of SQL Server is scaring all my clients.

But I have a few problems with PostgreSQL that I'm stuck.

1) In my SQL Server database I have about 1,000 Stored
Procedures. In some cases, one SP calls another SP that calls another,
and so on. To do that, I use the EXEC command. I've read that PostgreSQL
only supports functions. Is there any kind of trick that I can use in
PostgreSQL to make easier the conversion of all my SPs? How could I do
this? I just can't get all my SPs and rewrite the code.

As far as I know there is no SQL Server compatibility for PostgreSQL.
So (not really related to the preceding statement), you will have to
rewrite your Stored Procedures. And don't let the terms confuse you
most (if not all) Store Procs can be written using PostgreSQL functions
(a procedure is generally a function that returns nothing in programming
terms). This will be the most painful point of the migration, but you
would/will have the same problem with migration to any other database.

Quote:
2) I use commands like CONVERT and CASE..WHEN..END in my
queries. This is another issue that I simply don't know what to do. Is
there any kind of library or product (if it exists, I but it) that can
solve this problem?

(In that I haven't read the SQL Server 2000 doc's take the following
statements with a grain of salt.)
for an appropriate reference start here:
http://www.postgresql.org/docs/view....functions.html
CASE is SQL standard => read will work in PostgreSQL as in SQL Server
2000 with little to no changes (Section 6.12.1 in the docs).
CONVERT is a type conversion function and would need to be rewritten
using the equivalent functions in PostgreSQL(Section 6.7 in the docs).

Quote:
Please, sorry my lack of knowledge in PostgreSQL. I'm a beginner
in this database, but I believe that is the answer to my problems, manly
because the SQL Server is unbearable to maintain.

We all have to start somewhere, best to start with the Fine Manual.

Quote:

Best Regards,

Ulisses Ponticelli Giorgi
MSC Computer Science



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




---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #2  
Old   
Shridhar Daithankar
 
Posts: n/a

Default Re: PostgreSQL - 07-02-2003 , 01:01 AM






On 26 Jun 2003 at 19:09, Ulisses Ponticelli Giorgi wrote:
Quote:
1) In my SQL Server database I have about 1,000 Stored
Procedures. In some cases, one SP calls another SP that calls another,
and so on. To do that, I use the EXEC command. I've read that PostgreSQL
only supports functions. Is there any kind of trick that I can use in
PostgreSQL to make easier the conversion of all my SPs? How could I do
this? I just can't get all my SPs and rewrite the code.
I was under impression functions are stored procedures. I mean OK, if you write
them in PL/PgSQL. Shouldn't be a problem barring syntax differences..

HTH

Bye
Shridhar

--
Fun experiments: Get a can of shaving cream, throw it in a freezer for about a
week. Then take it out, peel the metal off and put it where you want...
bedroom, car, etc. As it thaws, it expands an unbelievable amount.


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.