Re: Calling stored procredure from psycopg2

From: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
To: Graeme Gemmill <graeme(at)gemmill(dot)name>
Cc: psycopg(at)lists(dot)postgresql(dot)org
Subject: Re: Calling stored procredure from psycopg2
Date: 2018-01-23 17:54:27
Message-ID: 20180123175427.24yqbh4eh7xgv4ul@campbell-lange.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On 23/01/18, Graeme Gemmill (graeme(at)gemmill(dot)name) wrote:
> Daniele: What would be the 'search_path'?

Each database can have several schemas. To access schemas outside of the
default 'public' schema, you need to set the search_path.

https://www.postgresql.org/docs/current/static/runtime-config-client.html

If you are trying to use functions or data outside of the public schema
you can normally do so by either running something like

dbcur.execute('set search_path = %s' % self.search_path)

or fully qualify the target function or object in your query, eg:

select * from myschema.fn_myfunction(myschema.toys)

Rory

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Graeme 2018-01-24 17:48:28 Re: Calling stored procredure from psycopg2
Previous Message Ed Behn 2018-01-23 17:52:42 Re: Calling stored procredure from psycopg2