Re: [HACKERS] case_preservation_and_insensitivity = on - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: [HACKERS] case_preservation_and_insensitivity = on
Date
Msg-id 34db7e21-88b7-100e-1592-49db06964e0a@BlueTreble.com
Whole thread Raw
In response to Re: [HACKERS] case_preservation_and_insensitivity = on  (Joel Jacobson <joel@trustly.com>)
List pgsql-hackers
On 2/24/17 11:34 AM, Joel Jacobson wrote:
> SELECT  SomeCol,  OtherCol,   FooCol,   BarCol,   MyCol,   ExtraCol,   LastCol
> INTO     _SomeCol, _OtherCol, _FooCol, _BarCol, _MyCol, _ExtraCol, _LastCol
> FROM Foo
> WHERE Bar = 'Baz';
>
> This is to avoid typos that are then visually easy to spot, thanks to
> all chars being aligned.

Why not just use a record or the table composite? I'll commonly do stuff 
like:

DECLARE  r record
BEGIN  SELECT INTO STRICT r      blah, foo, bar, baz    FROM pirate  ;
  IF r.blah THEN RAISE 'Yaaarrrrr!' END IF;
...

(Well, to be honest I always try to write pirate apps in plR... ;P)
-- 
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 by date:

Previous
From: Jeff Janes
Date:
Subject: Re: [HACKERS] Poor memory context performance in large hash joins
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Checksums by default?