~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/sql/truncate.sql

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- Test basic TRUNCATE functionality.
 
2
CREATE TABLE truncate_a (col1 integer primary key);
 
3
INSERT INTO truncate_a VALUES (1);
 
4
INSERT INTO truncate_a VALUES (2);
 
5
SELECT * FROM truncate_a;
 
6
-- Roll truncate back
 
7
BEGIN;
 
8
TRUNCATE truncate_a;
 
9
ROLLBACK;
 
10
SELECT * FROM truncate_a;
 
11
-- Commit the truncate this time
 
12
BEGIN;
 
13
TRUNCATE truncate_a;
 
14
COMMIT;
 
15
SELECT * FROM truncate_a;
 
16
 
 
17
-- Test foreign constraint check
 
18
CREATE TABLE truncate_b(col1 integer references truncate_a);
 
19
INSERT INTO truncate_a VALUES (1);
 
20
SELECT * FROM truncate_a;
 
21
TRUNCATE truncate_a;
 
22
SELECT * FROM truncate_a;
 
23
 
 
24
DROP TABLE truncate_b;
 
25
DROP TABLE truncate_a;