Re: BUG #16195: current_schema always return "public"

Michael Paquier <[email protected]> Thu, 9 Jan 2020 13:15:21 +0900
Newsgroups gmane.comp.db.postgresql.bugs
Message-ID <[email protected]>
--5me2qT3T17SWzdxI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jan 07, 2020 at 04:06:05PM +0000, PG Bug reporting form wrote:
> Context:=20
> user "test" and schema "test" created on my DB.
>=20
> Connencted as test user on my DB:
> SHOW search_path -> "$user", public
> SELECT current_schema -> public
>=20
> Expectation -> SELECT current_schema -> test

With a database role named test:
=3D# show search_path ;
   search_path
-----------------
 "$user", public
(1 row)
=3D# select current_schema();
 current_schema
----------------
 public
(1 row)
=3D# create schema test;
CREATE SCHEMA
=3D# select current_schema();
 current_schema
----------------
 test
(1 row)

So your expectation is right, but not your test.
--
Michael

--5me2qT3T17SWzdxI
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4WqNkACgkQnvQgOdby
QH1oKQ//Y4p+vVnLuogJLQXfoJYjXBBg4Ixxtnchq9GvX53l5KLuxKqB4xRjeRYL
vrCt0UV130Hed8FKB/drsQb1Edcj0114iBc9KHpx1pGh1U+9Vn4qWz28QQd7d6jq
ZHtcjHIt8mFKhPQKhNcJg63jze7gQLA5MF0dztd5l0Ag4h4MgYVNyF7jQ/xicFYO
Tgth1XEz5HwTfoe9MBY1B80lyS1Yf4Kn8gdLbvdhrH5eeAO/cr4+q4bOzG8gY7ZK
QrbAkYbgQMUHg0JyfDMOuNs3cM+GWSxFt6IyDson3jeztqy2my6nhlfNl77wP5qo
nocRZ/G7Jh1cfwE5TXfA/EkU/qudGE5SlabfK7oqLTweGeWdNazddjI637asgXj5
hNqx/HqjPsbP03A526yD5R0DFlcERJNOGvDzJOSttvRr3IRxRERf3g7S84uCnGLn
z95cAOcxeX7EcPcvwdWC24WqLQnsLNkcR3dyEUgLp+bLFJFNCje3Dz0e4ERyP0NN
PQG8H4OE1ABigKYYFoZ1w/kafm7kE4PXk2haiiC2faEDnKEyrmWdn3/IHrHpYZQU
I4dDDsZZ3tQqX5G/neW860s5o+dZ+h85jajZzFX4oTzqM4+zqY/vviCT6y0+CHyt
+PNiBNztYjiYmqevIvT4JLyFz+9NpVHIEzMXPY3f0V0T7I62mD8=
=l9sO
-----END PGP SIGNATURE-----

--5me2qT3T17SWzdxI--