-- try char's of greater than 1 length INSERTINTO CHAR_TBL (f1) VALUES ('cd'); INSERTINTO CHAR_TBL (f1) VALUES ('c ');
SELECT * FROM CHAR_TBL;
SELECT c.* FROM CHAR_TBL c WHERE c.f1 <> 'a';
SELECT c.* FROM CHAR_TBL c WHERE c.f1 = 'a';
SELECT c.* FROM CHAR_TBL c WHERE c.f1 < 'a';
SELECT c.* FROM CHAR_TBL c WHERE c.f1 <= 'a';
SELECT c.* FROM CHAR_TBL c WHERE c.f1 > 'a';
SELECT c.* FROM CHAR_TBL c WHERE c.f1 >= 'a';
DROPTABLE CHAR_TBL;
-- -- Now test longer arrays of char -- -- This char_tbl was already created and filled in test_setup.sql. -- Here we just try to insert bad values. --
INSERTINTO CHAR_TBL (f1) VALUES ('abcde');
SELECT * FROM CHAR_TBL;
-- Also try it with non-error-throwing API SELECT pg_input_is_valid('abcd ', 'char(4)'); SELECT pg_input_is_valid('abcde', 'char(4)'); SELECT * FROM pg_input_error_info('abcde', 'char(4)');
-- -- Also test "char", which is an ad-hoc one-byte type. It can only -- really store ASCII characters, but we allow high-bit-set characters -- to be accessed via bytea-like escapes. --
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.