Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id BB0B5192E3B7 for ; Fri, 10 Aug 2012 02:20:17 -0300 (ADT) Received: from mail-gg0-f174.google.com ([209.85.161.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Szhdv-0007HI-85 for pgsql-admin@postgresql.org; Fri, 10 Aug 2012 05:20:17 +0000 Received: by ggdk6 with SMTP id k6so1268274ggd.19 for ; Thu, 09 Aug 2012 22:20:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=XQy0/8Rn17HQ0r4bdPA3XEXDnMcZj1ztzqZEE4rkwHo=; b=OrxqrcOU/dm9JK3JHmjfKFaTrWhqMgHxQEfIBbGA/P5gFh5EdPor9TTPkI5iw2f1t+ yhlm0ovELd3kxH9TzF0gHxNZ/lrOcgkxTm0Vd0PJMErwR4r+zn3Ul2MI1SHdl1RFDynL nvpOQ3j3AyH7PO7qRMshNaPvy4abm44TQVRuyVqLkAUWlmuS0EPGDzM0VP4BrSi79/e8 rySQ2O02lTuCTGiKXP6gLRgs5hEBCPF4fe9meA1nMYHnGDKD/1C3azpKbeeXsxO0xzvJ ZV8AfRGKragricovWqZbz6eyW2te75OgKmsmA0l9L7hlXcr9zIsRifEpzEQ/t28CwS0q +iCg== Received: by 10.66.73.5 with SMTP id h5mr3426899pav.79.1344576001710; Thu, 09 Aug 2012 22:20:01 -0700 (PDT) Received: from ayaki.localdomain (124-169-173-54.dyn.iinet.net.au. [124.169.173.54]) by mx.google.com with ESMTPS id qp6sm2587691pbc.55.2012.08.09.22.19.59 (version=SSLv3 cipher=OTHER); Thu, 09 Aug 2012 22:20:00 -0700 (PDT) Message-ID: <502499FC.6050505@ringerc.id.au> Date: Fri, 10 Aug 2012 13:19:56 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: karthi keyan CC: "pgsql-admin@postgresql.org" Subject: Re: Data migration to sql server 2008 References: <50220DC1.8030007@ringerc.id.au> <5023B1EF.8060709@ringerc.id.au> In-Reply-To: Content-Type: multipart/alternative; boundary="------------050406010706010902050005" X-Gm-Message-State: ALoCoQlfS+hpXnqzRvDeJR1T1B8O72lCBo1a1sBnqEeGkNMW/VrzC7uW+Vfjj4g3QwUzNZdvmHhJ X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/75 X-Sequence-Number: 39896 This is a multi-part message in MIME format. --------------050406010706010902050005 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 08/10/2012 12:35 PM, karthi keyan wrote: > > > Actually my need is import data from PostgreSQL , and the same > process into sql server. > I'm guessing you didn't see what I wrote in reply to your message, where I said: You haven't really shown enough information. In particular, where does this 'Postgre' variable/table/whatever come from? What is it? You should look at the PostgreSQL server logs to see if PostgreSQL is sending an error when you attempt the connection and if so, what it is. Consider also setting log_statement = 'all' in postgresql.conf so you can see exactly what queries this "openquery" tool runs against PostgreSQL. By the way, the easiest way to do this sort of thing is usually to COPY tablename TO '/some/file.csv' CSV from PostgreSQL, then load that file into MS SQL server. That's trivial to script with vbscript or whatever you prefer, using psql to get the data out of PostgreSQL. -- Craig Ringer --------------050406010706010902050005 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 08/10/2012 12:35 PM, karthi keyan wrote:


Actually my need is import data from PostgreSQL  , and the same process into sql server.

I'm guessing you didn't see what I wrote in reply to your message, where I said:

You haven't really shown enough information. In particular, where does this 'Postgre' variable/table/whatever come from? What is it?

You should look at the PostgreSQL server logs to see if PostgreSQL is sending an error when you attempt the connection and if so, what it is. Consider also setting log_statement = 'all' in postgresql.conf so you can see exactly what queries this "openquery" tool runs against PostgreSQL.


By the way, the easiest way to do this sort of thing is usually to

    COPY tablename TO '/some/file.csv' CSV

from PostgreSQL, then load that file into MS SQL server. That's trivial to script with vbscript or whatever you prefer, using psql to get the data out of PostgreSQL.

--
Craig Ringer
--------------050406010706010902050005--