pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
citext, actually probably using extensions
5+ messages / 5 participants
[nested] [flat]

* citext, actually probably using extensions
@ 2019-09-20 18:13  stan <stanb@panix.com>
  0 siblings, 1 reply; 5+ messages in thread

From: stan @ 2019-09-20 18:13 UTC (permalink / raw)
  To: pgsql-general

I was pointed to the citext type to help solve an issue for a project I am
working on. I looked at this page:

https://nandovieira.com/using-insensitive-case-columns-in-postgresql-with-citext
But I must be doing something wrong. As the PG superuser, I did this:

postgres=# CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
CREATE EXTENSION

and as the superuser it shows up in the \dx display

BUT as a normal user:

stan=> \dx
List of installed extensions
Name   | Version |   Schema   |         Description
					  
---------+---------+------------+------------------------------
plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural
				   language
 (1 row)

 It does not.

 What am I doing incorrectly?



-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: citext, actually probably using extensions
@ 2019-09-20 19:12  Tom Lane <tgl@sss.pgh.pa.us>
  parent: stan <stanb@panix.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2019-09-20 19:12 UTC (permalink / raw)
  To: stan <stanb@panix.com>; +Cc: pgsql-general

stan <stanb@panix.com> writes:
> But I must be doing something wrong. As the PG superuser, I did this:
> postgres=# CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
> CREATE EXTENSION

> and as the superuser it shows up in the \dx display

> BUT as a normal user:

> stan=> \dx
> List of installed extensions
> Name   | Version |   Schema   |         Description
					  
> ---------+---------+------------+------------------------------
> plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural
> 				   language
>  (1 row)

>  It does not.

Judging from the prompts you show, you installed the extension
in the "postgres" database, but you need it in the "stan" database.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: citext, actually probably using extensions
@ 2019-09-21 04:59  Rob Sargent <robjsargent@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Rob Sargent @ 2019-09-21 04:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: stan <stanb@panix.com>; pgsql-general



> On Sep 20, 2019, at 1:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> stan <stanb@panix.com> writes:
>> But I must be doing something wrong. As the PG superuser, I did this:
>> postgres=# CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
>> CREATE EXTENSION
> 
>> and as the superuser it shows up in the \dx display
> 
>> BUT as a normal user:
> 
>> stan=> \dx
>> List of installed extensions
>> Name   | Version |   Schema   |         Description
>                      
>> ---------+---------+------------+------------------------------
>> plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural
>>                   language
>> (1 row)
> 
>> It does not.
> 
> Judging from the prompts you show, you installed the extension
> in the "postgres" database, but you need it in the "stan" database.
> 
>            regards, tom lane
> 
> 
And if you install the extension in the template1 db it will be included in ‘create database’ calls. Rather than having to add it by hand each time 




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: citext, actually probably using extensions
@ 2019-09-21 06:01  Morris de Oryx <morrisdeoryx@gmail.com>
  parent: Rob Sargent <robjsargent@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Morris de Oryx @ 2019-09-21 06:01 UTC (permalink / raw)
  To: pgsql-general

Not sure about best practices, but what I'm going is like this:

* Create a schema named extensions.

* Install extensions in this special schema only. I don't put anything else
in there.

* Put the extensions schema early (left) in the search_path for each role.

* Grant execute access permissively on the functions in that schema.

If there's something deeply flawed about this strategy, I'd be keen to hear
about it. On the positive side, I find it simple to understand, maintain,
and explain to other people. YMMV

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: citext, actually probably using extensions
@ 2019-09-23 19:11  Kevin Brannen <KBrannen@efji.com>
  parent: Morris de Oryx <morrisdeoryx@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Kevin Brannen @ 2019-09-23 19:11 UTC (permalink / raw)
  To: Morris de Oryx <morrisdeoryx@gmail.com>; pgsql-general

> From: Morris de Oryx <morrisdeoryx@gmail.com>
>
> Not sure about best practices, but what I'm going is like this:
>
> * Create a schema named extensions.
> * Install extensions in this special schema only. I don't put anything else in there.
> * Put the extensions schema early (left) in the search_path for each role.
> * Grant execute access permissively on the functions in that schema.
>
> If there's something deeply flawed about this strategy, I'd be keen to hear about it. On the positive side, I find it simple to understand, maintain, and explain to other people. YMMV
>

We do approximately the same thing if it makes you feel better, although we call our schema "common".
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2019-09-23 19:11 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 18:13 citext, actually probably using extensions stan <stanb@panix.com>
2019-09-20 19:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-09-21 04:59   ` Rob Sargent <robjsargent@gmail.com>
2019-09-21 06:01     ` Morris de Oryx <morrisdeoryx@gmail.com>
2019-09-23 19:11       ` Kevin Brannen <KBrannen@efji.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox