Re: How to Create a table in another database

[email protected] Thu, 12 Nov 2015 21:21:47 +0100
Newsgroups gmane.comp.db.postgresql.php
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------090200070207030003020806
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 12.11.2015 19:56, Guillaume Lelarge wrote:
> Hey,
>
> 2015-11-12 11:26 GMT+01:00 Archana K N <[email protected]
> <mailto:[email protected]>>:
>
>     Hello,
>
>          I created a postgres function in/*db1*/, from which I need to create a
>     table in another database say *db2. *I tried to use 'dblink' but it is giving
>     the error:-
>
>
>        ERROR:  function dblink_connect(unknown, unknown) does not exist
>        LINE 1: select dblink_connect('dbname=mydb port=5432 host=localhost ...
>                    ^
>        HINT:  No function matches the given name and argument types. You might need
>           to add explicit type casts.
>
>          Have been stuck on this for 2 days. Dont know what to do. 
>          
>          I am using Windows 7 OS(32-bit) and due to certain security purpose am
>     using         Postgres 9.0(cant update it to newer version). 
>
>           Please help me. 
>
>
> Have you installed dblink on the db1 database? If yes, can you give us the complete
> query that begins with "select dblink_connect..." ?
>
>
to me it looks like Archana is mixing PHP and SQL.  "more details" certainly is the
right reaction here.

/Str.

--------------090200070207030003020806
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Ty=
pe">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">On 12.11.2015 19:56, Guillaume Lelarge=

      wrote:<br>
    </div>
    <blockquote
cite=3D"mid:[email protected]=
l.com"
      type=3D"cite">
      <meta http-equiv=3D"Context-Type" content=3D"text/html; charset=3DU=
TF-8">
      <div dir=3D"ltr">Hey,<br>
        <div class=3D"gmail_extra"><br>
          <div class=3D"gmail_quote">2015-11-12 11:26 GMT+01:00 Archana K=

            N <span dir=3D"ltr">&lt;<a moz-do-not-send=3D"true"
                href=3D"mailto:[email protected]" target=3D"_blank">a=
[email protected]</a>&gt;</span>:<br>
            <blockquote class=3D"gmail_quote">
              <div dir=3D"ltr">Hello,
                <div><br>
                </div>
                <div>=C2=A0 =C2=A0 =C2=A0I created a postgres function in=
<i><b> db1</b></i>,
                  from which I need to create a table in another
                  database say <b>db2. </b>I tried to use 'dblink' but
                  it is giving the error:-</div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>=C2=A0 =C2=A0ERROR: =C2=A0function dblink_connect(un=
known,
                  unknown) does not exist
                  <div>=C2=A0 =C2=A0LINE 1: select dblink_connect('dbname=
=3Dmydb
                    port=3D5432 host=3Dlocalhost ...</div>
                  <div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0^</div>
                  <div>=C2=A0 =C2=A0HINT: =C2=A0No function matches the g=
iven name and
                    argument types. You might need =C2=A0 =C2=A0 =C2=A0 t=
o add explicit
                    type casts.</div>
                  <div><br>
                  </div>
                  <div>=C2=A0 =C2=A0 =C2=A0Have been stuck on this for 2 =
days. Dont
                    know what to do.=C2=A0</div>
                  <div>=C2=A0 =C2=A0 =C2=A0</div>
                  <div>=C2=A0 =C2=A0 =C2=A0I am using Windows 7 OS(32-bit=
) and due to
                    certain security purpose am using =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 Postgres
                    9.0(cant update it to newer version).=C2=A0</div>
                  <div><br>
                  </div>
                  <div>=C2=A0 =C2=A0 =C2=A0 Please help me.=C2=A0</div>
                  <span class=3D"HOEnZb">
                    <div><br>
                    </div>
                  </span></div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Have you installed dblink on the db1 database? If yes,
              can you give us the complete query that begins with
              "select dblink_connect..." ?<br>
              <br>
            </div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    to me it looks like Archana is mixing PHP and SQL.=C2=A0 "more detail=
s"
    certainly is the right reaction here.<br>
    <br>
    /Str.<br>
  </body>
</html>

--------------090200070207030003020806--