Re: case_preservation_and_insensitivity = on

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Joel Jacobson <joel(at)trustly(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: case_preservation_and_insensitivity = on
Date: 2017-02-24 19:57:25
Message-ID: 34db7e21-88b7-100e-1592-49db06964e0a@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2017-02-24 20:02:04 Re: Checksums by default?
Previous Message Jeff Janes 2017-02-24 19:57:17 Re: Poor memory context performance in large hash joins