agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: skinner@britvault.co.uk
To: pgsql-sql@postgresql.org
Subject: Re: Advice - indexing on varchar fields where only last x characters known
Date: Thu, 17 Oct 2013 12:45:12 +0100
Message-ID: <20131017114512.GA24563@teak.britvault.co.uk> (raw)
In-Reply-To: <201310171220.44550.gary.stainburn@ringways.co.uk>
References: <201310171220.44550.gary.stainburn@ringways.co.uk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

On 2013-10-17 Thu 12:20 PM |, Gary Stainburn wrote:
> 
> The problem that I have is that these VIN numbers are provided by a number of 
> data systems including manufacturer feeds, logistics companies as well as 
> internal systems. Some use the full 17 character string while others only use 
> the last 11.
> 

Split the vin into 2/3 columns?
vin_prefix (NULL), vin_suffix (NOT NULL)
vin_prefix, vin_centre, vin_suffix

UNIQUE all together in 1 constraint & index each separately.

Maybe...
-- 
Craig Skinner | http://twitter.com/Craig_Skinner | http://linkd.in/yGqkv7


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (11+ messages)  latest in thread

Message-ID: <20131017114512.GA24563@teak.britvault.co.uk>
Permalink:  ../20131017114512.GA24563@teak.britvault.co.uk/
Also on:    postgresql.org/message-id/20131017114512.GA24563@teak.britvault.co.uk

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: skinner@britvault.co.uk
  Subject: Re: Advice - indexing on varchar fields where only last x characters known
  In-Reply-To: <20131017114512.GA24563@teak.britvault.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox