Re: Trying to create implicit casts to text in PG 8.3 - Mailing list pgsql-general

From Sam Mason
Subject Re: Trying to create implicit casts to text in PG 8.3
Date
Msg-id 20090113173751.GL3008@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: Trying to create implicit casts to text in PG 8.3  ("Joshua D. Drake" <jd@commandprompt.com>)
List 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

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Cast for text->Integer missing in 8.3.5
Next
From: Tom Lane
Date:
Subject: Re: Cast for text->Integer missing in 8.3.5