CREATE FUNCTION phone_in(opaque)
 RETURNS phone
 AS '/home/postgres/linux/src/phone/phone.so'
 LANGUAGE 'c';

CREATE FUNCTION phone_out(opaque)
 RETURNS opaque
 AS '/home/postgres/linux/src/phone/phone.so'
 LANGUAGE 'c';

CREATE TYPE phone (
 internallength =8,
 input = phone_in,
 output = phone_out);

CREATE TABLE test_phone (
 mynumber phone,
 hernumber phone);

INSERT INTO test_phone VALUES ('01483-827294','0161-2242394');
INSERT INTO test_phone VALUES ('0171-8235465','01189-887762');

SELECT * FROM test_phone; 

DROP FUNCTION phone_in(opaque);
DROP FUNCTION phone_out(opaque);
DROP TYPE phone;
DROP TABLE test_phone;
