Re: How to get the size of JSONB in bytes?

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Petr Korobeinikov <pkorobeinikov(at)gmail(dot)com>, Dmitry Savenko <ds(at)dsavenko(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to get the size of JSONB in bytes?
Date: 2015-12-16 00:52:44
Message-ID: 5670B5DC.3010101@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/15/15 8:24 AM, Petr Korobeinikov wrote:
> The better approach is extract your length-validation logic into your
> application.

That's really up to interpretation.

The database is the only place the data is stored, and as such is the
only place that can constrain that data in all places.

If you're accepting data from a web form or something you certainly want
it to also check things, so the user gets immediate feedback. But for
anything you need to guarantee, you need to use the database.
--
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2015-12-16 00:59:00 Re: wal receiver process always start after startup process recovering all WALs and need new WAL?
Previous Message Jim Nasby 2015-12-16 00:50:01 Re: Trigger function, C, lookup of attribute type