Project

General

Profile

« Previous | Next » 

Revision 10182

schemas/util.sql: added table_flag__set(), which stores a status flag by the presence of a table constraint

View differences:

schemas/util.sql
1331 1331

  
1332 1332

  
1333 1333
--
1334
-- Name: table_flag__set(regclass, text); Type: FUNCTION; Schema: util; Owner: -
1335
--
1336

  
1337
CREATE FUNCTION table_flag__set(table_ regclass, flag text) RETURNS void
1338
    LANGUAGE sql STRICT
1339
    AS $_$
1340
SELECT util.create_if_not_exists($$ALTER TABLE $$||$1||$$ ADD CONSTRAINT $$
1341
||quote_ident($2)||$$ CHECK (true)$$)
1342
$_$;
1343

  
1344

  
1345
--
1346
-- Name: FUNCTION table_flag__set(table_ regclass, flag text); Type: COMMENT; Schema: util; Owner: -
1347
--
1348

  
1349
COMMENT ON FUNCTION table_flag__set(table_ regclass, flag text) IS 'stores a status flag by the presence of a table constraint.
1350
idempotent.';
1351

  
1352

  
1353
--
1334 1354
-- Name: table_schema(regclass); Type: FUNCTION; Schema: util; Owner: -
1335 1355
--
1336 1356

  

Also available in: Unified diff