Re: Trying to create implicit casts to text in PG 8.3

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Trying to create implicit casts to text in PG 8.3
Date: 2009-01-13 17:37:51
Message-ID: 20090113173751.GL3008@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 13, 2009 at 09:14:15AM -0800, Joshua D. Drake wrote:
> On Tue, 2009-01-13 at 16:58 +0000, Sam Mason wrote:
> > In the end, any type system is just a tool. It's main job is to find
> > bugs in code by spotting a common class of error
>
> The purpose of the database as a whole is to preserve the integrity of
> your data. The type system is a key component of that. The main job of
> the type system is to assist in insuring that your data is correct.

I think we're saying the same thing, but just to make sure: it's
technically possible (but practically *very* difficult) to "preserve the
integrity of your data" without having any type system. Knowing this,
languages have some type system (either statically enforced at compile
time, or dynamically checked during interpretation, or some mixture of
both) to ask us for clarification when we've written some code that
looks "a bit dubious".

As a side note, modern languages have extended types a long way. Some
to the extent that you can program at the type level, giving the user
many more tools to constrain the dynamic aspects of their code. One
fun experiment I've never really managed to get my head around is
Chameleon[1].

Sam

[1] http://taichi.ddns.comp.nus.edu.sg/taichiwiki/ChameleonHomePage

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-01-13 18:08:00 Re: Cast for text->Integer missing in 8.3.5
Previous Message Scott Marlowe 2009-01-13 17:24:12 Re: Cast for text->Integer missing in 8.3.5