Re: check constriaint for BLOB

Поиск
Список
Период
Сортировка
От Aasmund Midttun Godal
Тема Re: check constriaint for BLOB
Дата
Msg-id 20011127194018.1163.qmail@213-145-170-138.dd.nextgentel.com
обсуждение исходный текст
Ответ на Re: check constriaint for BLOB  ("Howard Williams" <howieshouse@home.com>)
Список pgsql-general
CREATE FUNCTION lo_size (OID) RETURNS NUMERIC AS 'SELECT   sum(octet_length(data)) FROM pg_largeobject WHERE loid = $1
GROUPBY (loid)' LANGUAGE 'sql'; 

Yes you can use largeobject - then you would something along the line of

CREATE TABLE byteaisbetter (
    loid OID CHECK (lo_size(loid) > 1000000)
);

But bytea is better....

Regards,

Aasmund.

On Mon, 26 Nov 2001 18:22:49 -0800, "Howard Williams" <howieshouse@home.com> wrote:
> Thanks for the response, but...
>
> I'm using data type oid - as far as I know, that's not the same thing as
> byteA.  Please correct me if I'm wrong.
>
> Howie
>
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Aasmund Midttun
> Godal
> Sent: Monday, November 26, 2001 5:02 PM
> To: howieshouse@home.com
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] check constriaint for BLOB
>
>
> CREATE TABLE testus (
>     data BYTEA CHECK (octet_length(data) > 10000)
> );
> Perhaps?
>
> Regards,
>
> Aasmund.
>
> On Mon, 26 Nov 2001 15:36:28 -0800, "news.postgresql.org"
> <howieshouse@home.com> wrote:
>
> Aasmund Midttun Godal
>
> aasmund@godal.com - http://www.godal.com/
> +47 40 45 20 46
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

Aasmund Midttun Godal

aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46

В списке pgsql-general по дате отправления:

Предыдущее
От: Fran Fabrizio
Дата:
Сообщение: Adding a rule makes my sequence increment twice
Следующее
От: teg@redhat.com (Trond Eivind Glomsrød)
Дата:
Сообщение: Re: Postgres 7.1.3 RPMs for RedHat 6.2 ?