X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 42C1B310C00 for ; Tue, 1 Jul 2003 23:37:36 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 48599-09 for ; Tue, 1 Jul 2003 20:37:25 -0300 (ADT) Received: from mail.ez3pl.com (66-136-75-131.ded.swbell.net [66.136.75.131]) by svr1.postgresql.org (Postfix) with ESMTP id 31D49310D85 for ; Tue, 1 Jul 2003 20:37:25 -0300 (ADT) Received: from speedfc.com (djackson.espeedfulfillment.com [172.25.96.11]) by mail.ez3pl.com (8.11.2/8.11.2) with ESMTP id h61NaY207214; Tue, 1 Jul 2003 18:36:34 -0500 Message-ID: <3F021B07.8000702@speedfc.com> Date: Tue, 01 Jul 2003 18:36:39 -0500 From: DeJuan Jackson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ulisses Ponticelli Giorgi Cc: pgsql-general@postgresql.org Subject: Re: PostgreSQL References: <00da01c33c2f$aecf0c40$1f00a8c0@compus.com.br> In-Reply-To: <00da01c33c2f$aecf0c40$1f00a8c0@compus.com.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Archive-Number: 200307/55 X-Sequence-Number: 44909 Welcome to the light. Ulisses Ponticelli Giorgi wrote: > 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. > 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.php?version=7.3&idoc=1&file=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). > > 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. > > >Best Regards, > >Ulisses Ponticelli Giorgi > MSC Computer Science > > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > >