I'm trying to create a custom type (PostgreSQL 9.0) which will essentially auto truncate a string to a certain length.
The type (auto_trunc_char) will be used as follows: Create table blah ( Some_name auto_trunc_char(40) ) Can this be done purely in plpgsql? If so, how? I know I have to declare the following (at least) but I'm not sure how to flesh out the functions: create type auto_trunc_char ( INTERNALLENGTH = VARIABLE, INPUT = auto_trunc_char_in_function, OUTPUT = auto_trunc_char_out_function, TYPMOD_IN = auto_trunc_char_modifier_in ); Regards, Russell Keane INPS Subscribe to the Vision e-newsletter<http://www.inps4.co.uk/news/enewsletter/> Subscribe to the Helpline Support Bulletin<http://www.inps4.co.uk/my_vision/helpline/support-bulletins> [cid:image001.png@01CC9AFA.4BF01AF0] Subscribe to the Helpline Blog RSS Feed<http://www.inps4.co.uk/rss/helplineblog.rss> ________________________________ Registered name: In Practice Systems Ltd. Registered address: The Bread Factory, 1a Broughton Street, London, SW8 3QJ Registered Number: 1788577 Registered in England Visit our Internet Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact is.helpd...@inps.co.uk
<<inline: image001.png>>