Re: named generic constraints [feature request] - Mailing list pgsql-hackers

From Caleb Cushing
Subject Re: named generic constraints [feature request]
Date
Msg-id 81bfc67a0911231751s1a1615b7w6187d046a98e74b0@mail.gmail.com
Whole thread Raw
In response to Re: named generic constraints [feature request]  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: named generic constraints [feature request]
Re: named generic constraints [feature request]
List pgsql-hackers
> CREATE OR REPLACE FUNCTION emptystr(text)
> RETURNS bool AS $$
>  SELECT $1 <> ''; -- it is SQL not C
> $$ LANGUAGE sql;
>
> CREATE TABLE users(
>  username TEXT CHECK (NOT emptystr(username)),

although I'm not going to continue discussing the request. this code
as the opposite desired effect. it should be

SELECT $1 = ''; -- you have a double negative

--
Caleb Cushing

http://xenoterracide.blogspot.com


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Next
From: Andrew Dunstan
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION