Re: [HACKERS] Press Release Draft - 2016-02-09 Cumulative Update
От | Jim Nasby |
---|---|
Тема | Re: [HACKERS] Press Release Draft - 2016-02-09 Cumulative Update |
Дата | |
Msg-id | 891336d3-cb33-eab4-0de6-140edd4f8b47@BlueTreble.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Press Release Draft - 2016-02-09 Cumulative Update (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Список | pgsql-hackers |
On 2/8/17 2:51 PM, Alvaro Herrera wrote: >> I always have a bit of mixed feelings with these kind of string >> manipulations on dynamic SQL. > It may look a bit nasty, but locking tables for long periods (or being > without an important index for a period) is much worse in production > scenarios. I think posting a recipe in the wiki is a great idea (especially if it handles corner cases like constraints). I'm not so keen on trying to code it entirely in psql though. I think it'd be a lot cleaner to have a plpgsql function that uses format() to construct the appropriate commands to run and then spit that out as text. Users can either cut and paste that, or they can \gset it to a variable that they then execute, or they can capture the output to a file which they execute. The big advantage to this is by default you see what commands would be run, but you can still fully automate if you want to without much extra effort. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532)
В списке pgsql-hackers по дате отправления: