Timeline for Insert trigger function from select query, plus static values pulled from the new.<record>
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 14, 2017 at 18:48 | comment | added | RDFozz | It's much easier to maintain, too. However, some people have a knee-jerk reaction to the phrase "dynamic SQL" (and, as I noted, I'm not really a PostgreSQL user, so it's possible that limits on what can happen in triggers might prevent this from working). Happy to try to help if you run into a snag, if I can. | |
Dec 14, 2017 at 18:38 | comment | added | cdm | The Dynamic SQL looks like it will work better for us. The reason being that the first one was made using my abbreviated table structure. In actuality, there are 150+ columns on the table and it isn't practical to use the if-else structure. Of course you had no idea of that. I'm going to give the Dynamic a whirl and see if it can be pulled off in Postgres. Thank you! | |
Dec 14, 2017 at 18:09 | history | answered | RDFozz | CC BY-SA 3.0 |