-- -- sanity check - if this fails go insane! -- SELECT1AS one;
-- ******************testing built-in type bool********************
-- check bool input syntax
SELECTtrueAStrue;
SELECTfalseASfalse;
SELECT bool 't'AStrue;
SELECT bool ' f 'ASfalse;
SELECT bool 'true'AStrue;
SELECT bool 'test'AS error;
SELECT bool 'false'ASfalse;
SELECT bool 'foo'AS error;
SELECT bool 'y'AStrue;
SELECT bool 'yes'AStrue;
SELECT bool 'yeah'AS error;
SELECT bool 'n'ASfalse;
SELECT bool 'no'ASfalse;
SELECT bool 'nay'AS error;
SELECT bool 'on'AStrue;
SELECT bool 'off'ASfalse;
SELECT bool 'of'ASfalse;
SELECT bool 'o'AS error;
SELECT bool 'on_'AS error;
SELECT bool 'off_'AS error;
SELECT bool '1'AStrue;
SELECT bool '11'AS error;
SELECT bool '0'ASfalse;
SELECT bool '000'AS error;
SELECT bool ''AS error;
-- Also try it with non-error-throwing API SELECT pg_input_is_valid('true', 'bool'); SELECT pg_input_is_valid('asdf', 'bool'); SELECT * FROM pg_input_error_info('junk', 'bool');
SELECT
d,
b ISTRUEAS istrue,
b ISNOTTRUEAS isnottrue,
b ISFALSEAS isfalse,
b ISNOTFALSEAS isnotfalse,
b IS UNKNOWN AS isunknown,
b ISNOT UNKNOWN AS isnotunknown FROM booltbl3 ORDERBY o;
-- Test to make sure short-circuiting and NULL handling is -- correct. Use a table as source to prevent constant simplification -- from interfering. CREATETABLE booltbl4(isfalse bool, istrue bool, isnul bool); INSERTINTO booltbl4 VALUES (false, true, null);
\pset null'(null)'
-- AND expression need to return null if there's any nulls and not all -- of the value are true SELECT istrue AND isnul AND istrue FROM booltbl4; SELECT istrue AND istrue AND isnul FROM booltbl4; SELECT isnul AND istrue AND istrue FROM booltbl4; SELECT isfalse AND isnul AND istrue FROM booltbl4; SELECT istrue AND isfalse AND isnul FROM booltbl4; SELECT isnul AND istrue AND isfalse FROM booltbl4;
-- OR expression need to return null if there's any nulls and none -- of the value is true SELECT isfalse OR isnul OR isfalse FROM booltbl4; SELECT isfalse OR isfalse OR isnul FROM booltbl4; SELECT isnul OR isfalse OR isfalse FROM booltbl4; SELECT isfalse OR isnul OR istrue FROM booltbl4; SELECT istrue OR isfalse OR isnul FROM booltbl4; SELECT isnul OR istrue OR isfalse FROM booltbl4;
-- -- Clean up -- Many tables are retained by the regression test, but these do not seem -- particularly useful so just get rid of them for now. -- - thomas 1997-11-30 --
DROPTABLE BOOLTBL1;
DROPTABLE BOOLTBL2;
DROPTABLE BOOLTBL3;
DROPTABLE BOOLTBL4;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.