| From: | Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | domain type and array, is it possible? |
| Date: | 2004-05-10 18:26:02 |
| Message-ID: | Pine.LNX.4.44.0405102019140.27891-100000@kix.fsv.cvut.cz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hello
Can I use domain in array. I want to save "xml normalized string"
into array.
CREATE OR REPLACE FUNCTION normString(varchar) RETURNS bool AS '
SELECT $1 !~ ''[\r\t\n]'';
' LANGUAGE sql;
CREATE OR REPLACE FUNCTION chLength(varchar, integer, integer) RETURNS
bool AS '
SELECT length($1) BETWEEN $2 AND $3;
' LANGUAGE sql;
CREATE DOMAIN optPostalLineType AS varchar(255)
CHECK(normString(value) AND chLength(value, 255));
CREATE TABLE addresses (
id serial primary key,
tbl char(1) NOT NULL CHECK (tbl IN ('s')),
type postalInfoEnumType,
street optPostalLineType[3] NULL,
city postalLineType,
zip zipType,
country countryType NULL
)
but I get message ERROR: type "optpostallinetype[]" does not exist.
Is it possible combine DOMAIN and array?
Thank You
Pavel Stehule
p.s. I use CVS PostgreSQL
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Frank Miles | 2004-05-10 18:49:18 | Re: nested elseif woes |
| Previous Message | Sally Sally | 2004-05-10 18:12:13 | Re: basic question (shared buffers vs. effective cache size) |