Re: Can I wrtie a function that has a BEFORE trigger that is not column name dpendent?

2019-09-14 Thread Adrian Klaver
On 9/14/19 12:44 PM, stan wrote: Please reply to list also. Ccing list. On Sat, Sep 14, 2019 at 11:50:08AM -0700, Adrian Klaver wrote: On 9/14/19 11:33 AM, stan wrote: I would like to write a generic function that I can place as a BEFORE trigger on several tables. It would do a max() on the c

Re: Can I wrtie a function that has a BEFORE trigger that is not column name dpendent?

2019-09-14 Thread Adrian Klaver
On 9/14/19 11:33 AM, stan wrote: I would like to write a generic function that I can place as a BEFORE trigger on several tables. It would do a max() on the column it was triggered for, and return(max + 1) unless max returns a NULL, in which case it would return one. Yes, I know this looks a lo

Can I wrtie a function that has a BEFORE trigger that is not column name dpendent?

2019-09-14 Thread stan
I would like to write a generic function that I can place as a BEFORE trigger on several tables. It would do a max() on the column it was triggered for, and return(max + 1) unless max returns a NULL, in which case it would return one. Yes, I know this looks a lot like a sequence, but normally thi

Re: Cascade Trigger Not Firing

2019-09-14 Thread Ron
On 9/14/19 9:54 AM, Tom Lane wrote: [snip The only mention of this feature in 38.1 "Overview of Trigger Behavior" is UPDATE triggers*can* moreover be set to fire only if certain columns are mentioned in the SET clause of the UPDATE statement. which seems to me to be plenty specific e

Re: Cascade Trigger Not Firing

2019-09-14 Thread Tom Lane
Adrian Klaver writes: > On 9/13/19 8:07 PM, Judy Loomis wrote: >> At the very least that note about this behavior should be highlighted, >> probably on the Trigger Behavior page and not buried in a bunch of notes >> on the Create Trigger page. > I know this after the fact. Still, as a general r

Re: kind of a bag of attributes in a DB . . .

2019-09-14 Thread Adrian Klaver
On 9/14/19 2:06 AM, Albretch Mueller wrote: just download a bunch of json info files from youtube data Feeds Actually, does postgresql has a json Driver of import feature? I'm working without a net(coffee) and so I forgot to mention that for Python there is: http://initd.org/psycopg/doc

Re: kind of a bag of attributes in a DB . . .

2019-09-14 Thread Adrian Klaver
On 9/14/19 2:06 AM, Albretch Mueller wrote: just download a bunch of json info files from youtube data Feeds Actually, does postgresql has a json Driver of import feature? Not sure what you mean by above? Postgres has json(b) data types that you can import JSON into: https://www.postgres

Re: Cascade Trigger Not Firing

2019-09-14 Thread Adrian Klaver
On 9/13/19 8:07 PM, Judy Loomis wrote: At the very least that note about this behavior should be highlighted, probably on the Trigger Behavior page and not buried in a bunch of notes on the Create Trigger page. I know this after the fact. Still, as a general rule the best place to start when

Re: kind of a bag of attributes in a DB . . .

2019-09-14 Thread Albretch Mueller
just download a bunch of json info files from youtube data Feeds Actually, does postgresql has a json Driver of import feature? the metadata contained in json files would require more than one small databases, but such an import feature should be trivial C