0

We have a postgresql 9.0 database which we want to connect to via Excel 2010 running the Power Query plugin. I've setup the machine running excel to be able to use Npgsql to do the connection according to these instructions http://office.microsoft.com/en-us/excel-help/connect-to-a-postgresql-database-HA104028095.aspx?CTT=5&origin=HA104003952. The connection fails in Excel with this error message:

DataSource.Error: PostgreSQL: ERROR: 42883: function concat(information_schema.character_data, unknown) does not exist Details: Message=ERROR: 42883:..., ErrorCode=-2147467259

Has anyone successfully connected to a postgresql database from Excel using the Power Query plugin? There's a menu item on the power query ribbon in excel specifically for postgresql so I figured it would work. The concat function isn't in our postgresql version of 9.0 so do I have to upgrade our postgresql database to do this?

5
  • 1
    It seems you need to upgrade - concat() appeared in 9.1 Commented Dec 5, 2013 at 9:41
  • Yeah I guess. I'm looking into pg_upgrade. I wonder why excel wants to use that function to simply connect to the database. Commented Dec 6, 2013 at 14:27
  • As "information_schema" is mentioned in the error, it probably retrieves some metadata (e.g. list of various existing DB objects). Commented Dec 6, 2013 at 14:41
  • 1
    A workaround is possible - see here. Commented Dec 6, 2013 at 14:59
  • Added the function Milen and then I could connect. Thanks. Commented Dec 9, 2013 at 13:38

1 Answer 1

1

You can either upgrade or define your own function like this:

CREATE OR REPLACE concat(information_schema.character_data, varchar) 
RETURNS varchar LANGUAGE SQL AS
$$ SELECT $1::varchar || $2; $$;

But upgrading to 9.1 seems likely the best approach.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.