Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Bryn Llewellyn
david.g.johns...@gmail.com wrote:My code example ended up quite big—so I'll show it to you all only if you ask. But it's easy to describe. My script does this: 1. It creates three non-superuser roles: "data", "code", and "client". 2. It creates a text-book masters-and-details table pair with o

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread David G. Johnston
On Thu, Aug 11, 2022 at 8:41 PM Bryn Llewellyn wrote: > The conventions that this list's archive imposes (only plain text, quoted > content indicated with successively deep chevron-style marks, explicit URLs > twice as long as your arm, and baked-in hard line breaks at about a dozen > words) make

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Bryn Llewellyn
> rjuju...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> Nobody has told me how an outsider like me can deliver such a .zip file, >> together with its typographically nuanced external documentation… > > You mentioned previously that "Email attachments don't make it to the archive > for

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Julien Rouhaud
On Thu, Aug 11, 2022 at 04:20:20PM -0700, Bryn Llewellyn wrote: > > Nobody has told me how an outsider like me can deliver such a .zip file, > together with its typographically nuanced external documentation, to readers > of plsql-general. So this is what I'll do: You mentioned previously that "Em

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > > You are correct that the behavior here is not explicitly documented [where] I > would expect to find it. > > My expectation is that the trigger owner is the context in which the trigger > function is executed. Table owners can grant the ability to other r

Re: Strategy for preparing a query containg dynamic case / when

2022-08-11 Thread David G. Johnston
On Thu, Aug 11, 2022 at 1:19 PM Theofilos Theofovos wrote: > Hi subin, > > can you clarify please? > > I got a random nonsensical reply from this sender earlier today too...spam/hack/whatever, probably best to just ignore. David J.

Re: Strategy for preparing a query containg dynamic case / when

2022-08-11 Thread Theofilos Theofovos
Hi subin, can you clarify please? On Thu, Aug 11, 2022 at 3:42 PM subin wrote: > Please let me know if that is okay. > > On Thu, Aug 11, 2022 at 11:11 AM Theofilos Theofovos > wrote: > >> Hello, >> >> just for the sake of the example lets have this kind of table >> >> CREATE TABLE experimenta

Re: Postgres NOT IN vs NOT EXISTS optimization

2022-08-11 Thread Bruce Momjian
On Tue, Jun 14, 2022 at 12:09:16PM -0400, Tom Lane wrote: > "Dirschel, Steve" writes: > > Is Postgres able to drive the query the same way with the NOT IN as the > > NOT EXISTS is doing or is that only available if the query has a NOT > > EXISTS? > > NOT IN is not optimized very well in PG, becau

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread David G. Johnston
On Thu, Aug 11, 2022 at 9:28 AM Bryn Llewellyn wrote: > > *karsten.hilb...@gmx.net wrote:* > > *b...@yugabyte.com wrote:* > > I'll be happy to make a smaller example. It will, however, need to create… > After all, how would I know which of the eight to skip while I don't know > the intended rul

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Bryn Llewellyn
> karsten.hilb...@gmx.net wrote: > >> b...@yugabyte.com wrote: >> >> I'll be happy to make a smaller example. It will, however, need to create… >> After all, how would I know which of the eight to skip while I don't know >> the intended rules for the current_role? > > You'd certainly start out

Is ODBC list still alive?

2022-08-11 Thread Igor Korot
Thank you.

Re: Modelling a web CMS in Postgres ... a little advice needed

2022-08-11 Thread Rob Sargent
> On Aug 11, 2022, at 5:30 AM, Laura Smith > wrote: > > > > > > > Sent with Proton Mail secure email. > > --- Original Message --- > On Thursday, August 11th, 2022 at 13:11, Ray O'Donnell > wrote: > > >> On 11/08/2022 11:00, Laura Smith wrote: >> >>> Hi Tony >>> >>> The re

Re: Fwd: Modelling a web CMS in Postgres ... a little advice needed

2022-08-11 Thread Tony Shelver
On Thu, 11 Aug 2022 at 12:00, Laura Smith < n5d9xq3ti233xiyif...@protonmail.ch> wrote: > Hi Tony > > The reason I'm looking to do it from scratch is that its a case of "once > bitten, twice shy". > > This CMS will be replacing a Joomla based CMS. > > I can't quite say I'm enamoured by the option o

Re: Oddity that I don't understand

2022-08-11 Thread Perry Smith
I see why… The select of the view is picking d.ino which is null because there is no match in the dirents table. Thanks guys! > On Aug 11, 2022, at 08:23, Perry Smith wrote: > > I’m tempted to ask “Is this a bug” but I predict there is an explanation. > > I have a view: > find_dups=# \sv+ da

Oddity that I don't understand

2022-08-11 Thread Perry Smith
I’m tempted to ask “Is this a bug” but I predict there is an explanation. I have a view: find_dups=# \sv+ dateien 1 CREATE OR REPLACE VIEW public.dateien AS 2SELECT d.id, 3 d.basename, 4 d.parent_id, 5 d.ino, 6 d.ext, 7 i.ftype, 8

Re: Fwd: Modelling a web CMS in Postgres ... a little advice needed

2022-08-11 Thread Laura Smith
Sent with Proton Mail secure email. --- Original Message --- On Thursday, August 11th, 2022 at 13:11, Ray O'Donnell wrote: > On 11/08/2022 11:00, Laura Smith wrote: > > > Hi Tony > > > > The reason I'm looking to do it from scratch is that its a case of > > "once bitten, twice sh

Strategy for preparing a query containg dynamic case / when

2022-08-11 Thread Theofilos Theofovos
Hello, just for the sake of the example lets have this kind of table CREATE TABLE experimentals ( indy integer not null primary KEY, XXX1 integer NOT NULL, XXX2 integer NOT NULL, json_data jsonb ); It emulates a case where an item has integer labels XXX1, and XXX2 and characteristics de

Re: Fwd: Modelling a web CMS in Postgres ... a little advice needed

2022-08-11 Thread Laura Smith
Hi Tony The reason I'm looking to do it from scratch is that its a case of "once bitten, twice shy". This CMS will be replacing a Joomla based CMS. I can't quite say I'm enamoured by the option of trading one "baggage included" opinionated CMS for another.  Also in this day and age, removing t

Fwd: Modelling a web CMS in Postgres ... a little advice needed

2022-08-11 Thread Tony Shelver
From: Tony Shelver Date: Thu, 11 Aug 2022 at 11:47 Subject: Re: Modelling a web CMS in Postgres ... a little advice needed To: Laura Smith On Thu, 11 Aug 2022 at 09:35, Laura Smith < n5d9xq3ti233xiyif...@protonmail.ch> wrote: > Hi > > I'm looking at using pgsql as a backend to a web CMS but c

Aw: Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Karsten Hilbert
I'll be happy to make a smaller example. It will, however, need to create users, a database, schemas, and some number of triggers. Because the triggers, their functions, and everything else about them follow a pattern, I can use "format()" and dynamic SQL to generate them. I'll still need those

Modelling a web CMS in Postgres ... a little advice needed

2022-08-11 Thread Laura Smith
Hi I'm looking at using pgsql as a backend to a web CMS but could do with a little advice from the crowd on the wiseness of my schema thinking. TL;DR the design is centered around two tables "pages" and "page_content", where "pages" has a jsonb column that refers to "page_content" in a key-valu