List:Database Benchmarks« Previous MessageNext Message »
From:Rod Taylor Date:October 4 2003 4:22am
Subject:PostgreSQL 7.3 results
View as plain text  
I was going through the crash-me pages and noticed a couple of funny
spots.

[" as identifier quote (ANSI SQL)] is marked as unsupported although
[Double "" in identifiers as "] is marked as supported.
        
        rbt=# select version();
                                       version
        ---------------------------------------------------------------------
         PostgreSQL 7.3.2 on i386-unknown-freebsd4.8, compiled by GCC
        2.95.4
        (1 row)
         
        rbt=# select 'text' AS "HeRe";
         HeRe
        ------
         text
        (1 row)
         
        rbt=# select 'text' AS HeRe;
         here
        ------
         text
        (1 row)


I was unsure what was meant by [Circular foreign keys] (Sorry, I've not
looked at crashme sources at this point).

As you can see below two tables are created each with a primary key
referring to the others primary key. A transaction which inserts
appropriate values into each table is accepted. As individual inserts
they are rejected. ON UPDATE .. and ON DELETE statements also function
in this method.

test=# create table a (col integer primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'a_pkey'
for table 'a'
CREATE TABLE
test=# create table b (col integer primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'b_pkey'
for table 'b'
CREATE TABLE
test=# alter table a add foreign key(col) references b initially
deferred;
NOTICE:  ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ALTER TABLE
test=# alter table b add foreign key(col) references a initially
deferred;
NOTICE:  ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ALTER TABLE
test=# begin;
BEGIN
test=# insert into a values (1);
INSERT 17031 1
test=# insert into b values (1);
INSERT 17032 1
test=# commit;
COMMIT
test=# insert into a values (5);
ERROR:  $1 referential integrity violation - key referenced from a not
found in b
test=# insert into b values (6);
ERROR:  $1 referential integrity violation - key referenced from b not
found in a
        

Thanks for your time.

Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Thread
PostgreSQL 7.3 resultsRod Taylor4 Oct