On 1/7/17 2:06 AM, Pavel Stehule wrote:
SELECT t1 := c1, t2 := c2, ... - it can be PostgreSQL specific syntax - full control over design - maximally robust against typo - long syntax, but for short syntax can be used SELECT c1,c2,c3, .. INTO STRICT recvar
I don't think overloading a SQL command is a good idea. We'd be in trouble if ANSI ever introduced :=. I think that could also conflict with existing operators.
- what should be no_data_found behave?
Considering where we're at today, I don't think there should be a default behavior; make the user specify somehow whether missing data is allowed or not.
I have nothing about a cost of "new syntax" implementation - but for me - it looks like good solution for us - it can be win/win solution. It breaks nothing - it introduce nice to have typo robust syntax.
Related to that, I suspect we could add better support to existing commands for at least some of these things. For example, SELECT ... INTO NOMULTI (instead of STRICT) to indicate that multiple rows are an error but missing data is OK.
-- 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) -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers