Thread: [NOVICE] FDW user mapping

[NOVICE] FDW user mapping

From
Nikhil Kshirsagar
Date:

Hello,

 

I want to create foreign data wrapper to access table from SQL server 2012.

I have PostgreSQL9.6. I am facing issues while trying to create user mapping. Please find details below

 

  1. From “http://www.postgresonline.com/journal/archives/361-Foreign-Data-Wrappers-for-PostgreSQL-9.5-windows.html” link, I did download and install PostgreSQL 9.6 w64 FDWs installed with name 'LocalSQL2012ForPg'
  2. Installed the ODBC FDW in PostgreSQL with SQL Statement: CREATE EXTENSION odbc_fdw;
  3. Ran - CREATE SERVER localsql2012 FOREIGN DATA WRAPPER odbc_fdw OPTIONS (dsn 'LocalSQL2012ForPg');
  4. Next I am trying to run below query –

CREATE USER MAPPING

   FOR postgres               

   SERVER localsql2012

  OPTIONS (username 'pgadmin’,password ‘pgadmin');

 

When I execute above query, I constantly get below error – “ERROR: invalid option "username"
HINT: Valid options in this context are: <none>”

 

I verified that pgadmin user is present and can access MS SQL server 2012.

 

Can you please let me know what I am missing?

 

Thanks & Regards,

Nikhil Kshirsagar

REI Systems, Inc…..Achieving Excellence Together

Ph.No. : (703)-480-7638 | Cell No:  (972)-839-9027

nkshirsagar@reisys.com | www.reisys.com

 

Re: [NOVICE] FDW user mapping

From
Stephen Cook
Date:
It is "user", not "username". This happens to me often :)

-- Stephen


On 2017-09-28 16:15, Nikhil Kshirsagar wrote:
> Hello,
> 
>  
> 
> I want to create foreign data wrapper to access table from SQL server 2012.
> 
> I have PostgreSQL9.6. I am facing issues while trying to create user
> mapping. Please find details below
> 
>  
> 
>  1. From
>     “http://www.postgresonline.com/journal/archives/361-Foreign-Data-Wrappers-for-PostgreSQL-9.5-windows.html”
>     link, I did download and install PostgreSQL 9.6 w64 FDWs installed
>     with name'LocalSQL2012ForPg'
>  2. Installed the ODBC FDW in PostgreSQL with SQL Statement: CREATE
>     EXTENSION odbc_fdw;
>  3. Ran - CREATE SERVER localsql2012 FOREIGN DATA WRAPPER odbc_fdw
>     OPTIONS (dsn 'LocalSQL2012ForPg');
>  4. Next I am trying to run below query –
> 
> CREATE USER MAPPING
> 
>    FOR postgres               
> 
>    SERVER localsql2012
> 
>   OPTIONS (username 'pgadmin’,password ‘pgadmin');
> 
>  
> 
> When I execute above query, I constantly get below error – “ERROR:
> invalid option "username"
> HINT: Valid options in this context are: <none>”
> 
>  
> 
> I verified that pgadmin user is present and can access MS SQL server 2012.
> 
>  
> 
> Can you please let me know what I am missing?
> 
>  
> 
> Thanks & Regards,
> 
> *Nikhil Kshirsagar*
> 
> REI Systems, Inc…..Achieving Excellence Together
> 
> Ph.No. : (703)-480-7638 | Cell No:  (972)-839-9027
> 
> nkshirsagar@reisys.com <mailto:nkshirsagar@reisys.com> | www.reisys.com
> <http://www.reisys.com/>
> 
>  
> 



-- 
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [NOVICE] FDW user mapping

From
Nikhil Kshirsagar
Date:
Hello,

I tried using user instead of username. I get the same error -
"ERROR:
invalid option "user"
HINT: Valid options in this context are: <none>"

-----Original Message-----
From: Stephen Cook [mailto:sclists@gmail.com]
Sent: Thursday, September 28, 2017 11:01 PM
To: Nikhil Kshirsagar <nkshirsagar@reisystems.com>; pgsql-novice@postgresql.org
Subject: Re: [NOVICE] FDW user mapping

It is "user", not "username". This happens to me often :)

-- Stephen


On 2017-09-28 16:15, Nikhil Kshirsagar wrote:
> Hello,
>
>  
>
> I want to create foreign data wrapper to access table from SQL server 2012.
>
> I have PostgreSQL9.6. I am facing issues while trying to create user
> mapping. Please find details below
>
>  
>
>  1. From
>     "http://www.postgresonline.com/journal/archives/361-Foreign-Data-Wrappers-for-PostgreSQL-9.5-windows.html"
>     link, I did download and install PostgreSQL 9.6 w64 FDWs installed
>     with name'LocalSQL2012ForPg'
>  2. Installed the ODBC FDW in PostgreSQL with SQL Statement: CREATE
>     EXTENSION odbc_fdw;
>  3. Ran - CREATE SERVER localsql2012 FOREIGN DATA WRAPPER odbc_fdw
>     OPTIONS (dsn 'LocalSQL2012ForPg');  4. Next I am trying to run
> below query -
>
> CREATE USER MAPPING
>
>    FOR postgres
>
>    SERVER localsql2012
>
>   OPTIONS (username 'pgadmin',password 'pgadmin');
>
>  
>
> When I execute above query, I constantly get below error - "ERROR:
> invalid option "username"
> HINT: Valid options in this context are: <none>"
>
>  
>
> I verified that pgadmin user is present and can access MS SQL server 2012.
>
>  
>
> Can you please let me know what I am missing?
>
>  
>
> Thanks & Regards,
>
> *Nikhil Kshirsagar*
>
> REI Systems, Inc...Achieving Excellence Together
>
> Ph.No. : (703)-480-7638 | Cell No:  (972)-839-9027
>
> nkshirsagar@reisys.com <mailto:nkshirsagar@reisys.com> |
> www.reisys.com <http://www.reisys.com/>
>
>  
>



--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [NOVICE] FDW user mapping

From
Tom Lane
Date:
Nikhil Kshirsagar <nkshirsagar@reisystems.com> writes:
> I tried using user instead of username. I get the same error - 
> "ERROR: invalid option "user"
> HINT: Valid options in this context are: <none>"

The fact that it isn't presenting a useful list of options in the HINT
seems like a bug in itself, and it might be a clue to what's going wrong.
But you need to contact the author of odbc_fdw, whoever that is.
        regards, tom lane


-- 
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice