Re: Request for supported platforms - Mailing list pgsql-hackers

From Alessio Bragadini
Subject Re: Request for supported platforms
Date
Msg-id 1036139141.18523.80.camel@iris
Whole thread Raw
In response to Re: Request for supported platforms  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Request for supported platforms  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, 2002-10-31 at 18:53, Tom Lane wrote:

> Evidently main.c needs "#include <errno.h>" added.

I wonder what have changed since Beta2 that compiled fine...

> Please add that and see if you get any further.

Done, and now it builds (I've limited the test to native cc compiler for
now). But it doesn't pass two regression tests, float8 and alter_table.

The diffs seem to me non-trivial, I've attached the results.

Any idea?

--
Alessio F. Bragadini        alessio@albourne.com
APL Financial Services        http://village.albourne.com
Nicosia, Cyprus             phone: +357-22-755750

"It is more complicated than you think"
        -- The Eighth Networking Truth from RFC 1925
*** ./expected/float8-fp-exception.out    Thu Mar 30 10:46:00 2000
--- ./results/float8.out    Fri Nov  1 10:16:14 2002
***************
*** 149,161 ****
        | 1.2345678901234e-200 |                    0
  (5 rows)

  SELECT sqrt(float8 '64') AS eight;
   eight
  -------
       8
  (1 row)

- -- square root
  SELECT |/ float8 '64' AS eight;
   eight
  -------
--- 149,194 ----
        | 1.2345678901234e-200 |                    0
  (5 rows)

+ -- ceil
+ select ceil(f1) as ceil_f1 from float8_tbl f;
+        ceil_f1
+ ----------------------
+                     0
+                  1005
+                   -34
+  1.2345678901234e+200
+                     1
+ (5 rows)
+
+ -- floor
+ select floor(f1) as floor_f1 from float8_tbl f;
+        floor_f1
+ ----------------------
+                     0
+                  1004
+                   -35
+  1.2345678901234e+200
+                     0
+ (5 rows)
+
+ -- sign
+ select sign(f1) as sign_f1 from float8_tbl f;
+  sign_f1
+ ---------
+        0
+        1
+       -1
+        1
+        1
+ (5 rows)
+
+ -- square root
  SELECT sqrt(float8 '64') AS eight;
   eight
  -------
       8
  (1 row)

  SELECT |/ float8 '64' AS eight;
   eight
  -------

======================================================================

*** ./expected/alter_table.out    Sat Oct 19 04:35:43 2002
--- ./results/alter_table.out    Fri Nov  1 10:17:19 2002
***************
*** 940,1168 ****
  alter table atacc1 drop d;
  alter table atacc1 drop b;
  select * from atacc1;
!
! --
! (1 row)
!
! drop table atacc1;
! -- test inheritance
! create table parent (a int, b int, c int);
! insert into parent values (1, 2, 3);
! alter table parent drop a;
! create table child (d varchar(255)) inherits (parent);
! insert into child values (12, 13, 'testing');
! select * from parent;
!  b  | c
! ----+----
!   2 |  3
!  12 | 13
! (2 rows)
!
! select * from child;
!  b  | c  |    d
! ----+----+---------
!  12 | 13 | testing
! (1 row)
!
! alter table parent drop c;
! select * from parent;
!  b
! ----
!   2
!  12
! (2 rows)
!
! select * from child;
!  b  |    d
! ----+---------
!  12 | testing
! (1 row)
!
! drop table child;
! drop table parent;
! -- test copy in/out
! create table test (a int4, b int4, c int4);
! insert into test values (1,2,3);
! alter table test drop a;
! copy test to stdout;
! 2    3
! copy test(a) to stdout;
! ERROR:  Relation "test" has no column "a"
! copy test("........pg.dropped.1........") to stdout;
! ERROR:  Relation "test" has no column "........pg.dropped.1........"
! copy test from stdin;
! ERROR:  copy: line 1, Extra data after last expected column
! lost synchronization with server, resetting connection
! SET autocommit TO 'on';
! select * from test;
!  b | c
! ---+---
!  2 | 3
! (1 row)
!
! copy test from stdin;
! select * from test;
!  b  | c
! ----+----
!   2 |  3
!  21 | 22
! (2 rows)
!
! copy test(a) from stdin;
! ERROR:  Relation "test" has no column "a"
! copy test("........pg.dropped.1........") from stdin;
! ERROR:  Relation "test" has no column "........pg.dropped.1........"
! copy test(b,c) from stdin;
! select * from test;
!  b  | c
! ----+----
!   2 |  3
!  21 | 22
!  31 | 32
! (3 rows)
!
! drop table test;
! -- test inheritance
! create table dropColumn (a int, b int, e int);
! create table dropColumnChild (c int) inherits (dropColumn);
! create table dropColumnAnother (d int) inherits (dropColumnChild);
! -- these two should fail
! alter table dropColumnchild drop column a;
! ERROR:  ALTER TABLE: Cannot drop inherited column "a"
! alter table only dropColumnChild drop column b;
! ERROR:  ALTER TABLE: Cannot drop inherited column "b"
! -- these three should work
! alter table only dropColumn drop column e;
! alter table dropColumnChild drop column c;
! alter table dropColumn drop column a;
! create table renameColumn (a int);
! create table renameColumnChild (b int) inherits (renameColumn);
! create table renameColumnAnother (c int) inherits (renameColumnChild);
! -- these three should fail
! alter table renameColumnChild rename column a to d;
! ERROR:  renameatt: inherited attribute "a" may not be renamed
! alter table only renameColumnChild rename column a to d;
! ERROR:  Inherited attribute "a" must be renamed in child tables too
! alter table only renameColumn rename column a to d;
! ERROR:  Inherited attribute "a" must be renamed in child tables too
! -- these should work
! alter table renameColumn rename column a to d;
! alter table renameColumnChild rename column b to a;
! -- this should work
! alter table renameColumn add column w int;
! -- this should fail
! alter table only renameColumn add column x int;
! ERROR:  Attribute must be added to child tables too
! -- Test corner cases in dropping of inherited columns
! create table p1 (f1 int, f2 int);
! create table c1 (f1 int not null) inherits(p1);
! NOTICE:  CREATE TABLE: merging attribute "f1" with inherited definition
! -- should be rejected since c1.f1 is inherited
! alter table c1 drop column f1;
! ERROR:  ALTER TABLE: Cannot drop inherited column "f1"
! -- should work
! alter table p1 drop column f1;
! -- c1.f1 is still there, but no longer inherited
! select f1 from c1;
!  f1
! ----
! (0 rows)
!
! alter table c1 drop column f1;
! select f1 from c1;
! ERROR:  Attribute "f1" not found
! drop table p1 cascade;
! NOTICE:  Drop cascades to table c1
! create table p1 (f1 int, f2 int);
! create table c1 () inherits(p1);
! -- should be rejected since c1.f1 is inherited
! alter table c1 drop column f1;
! ERROR:  ALTER TABLE: Cannot drop inherited column "f1"
! alter table p1 drop column f1;
! -- c1.f1 is dropped now, since there is no local definition for it
! select f1 from c1;
! ERROR:  Attribute "f1" not found
! drop table p1 cascade;
! NOTICE:  Drop cascades to table c1
! create table p1 (f1 int, f2 int);
! create table c1 () inherits(p1);
! -- should be rejected since c1.f1 is inherited
! alter table c1 drop column f1;
! ERROR:  ALTER TABLE: Cannot drop inherited column "f1"
! alter table only p1 drop column f1;
! -- c1.f1 is NOT dropped, but must now be considered non-inherited
! alter table c1 drop column f1;
! drop table p1 cascade;
! NOTICE:  Drop cascades to table c1
! create table p1 (f1 int, f2 int);
! create table c1 (f1 int not null) inherits(p1);
! NOTICE:  CREATE TABLE: merging attribute "f1" with inherited definition
! -- should be rejected since c1.f1 is inherited
! alter table c1 drop column f1;
! ERROR:  ALTER TABLE: Cannot drop inherited column "f1"
! alter table only p1 drop column f1;
! -- c1.f1 is still there, but no longer inherited
! alter table c1 drop column f1;
! drop table p1 cascade;
! NOTICE:  Drop cascades to table c1
! create table p1(id int, name text);
! create table p2(id2 int, name text, height int);
! create table c1(age int) inherits(p1,p2);
! NOTICE:  CREATE TABLE: merging multiple inherited definitions of attribute "name"
! create table gc1() inherits (c1);
! select relname, attname, attinhcount, attislocal
! from pg_class join pg_attribute on (pg_class.oid = pg_attribute.attrelid)
! where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
! order by relname, attnum;
!  relname | attname | attinhcount | attislocal
! ---------+---------+-------------+------------
!  c1      | id      |           1 | f
!  c1      | name    |           2 | f
!  c1      | id2     |           1 | f
!  c1      | height  |           1 | f
!  c1      | age     |           0 | t
!  gc1     | id      |           1 | f
!  gc1     | name    |           1 | f
!  gc1     | id2     |           1 | f
!  gc1     | height  |           1 | f
!  gc1     | age     |           1 | f
!  p1      | id      |           0 | t
!  p1      | name    |           0 | t
!  p2      | id2     |           0 | t
!  p2      | name    |           0 | t
!  p2      | height  |           0 | t
! (15 rows)
!
! -- should work
! alter table only p1 drop column name;
! -- should work. Now c1.name is local and inhcount is 0.
! alter table p2 drop column name;
! -- should be rejected since its inherited
! alter table gc1 drop column name;
! ERROR:  ALTER TABLE: Cannot drop inherited column "name"
! -- should work, and drop gc1.name along
! alter table c1 drop column name;
! -- should fail: column does not exist
! alter table gc1 drop column name;
! ERROR:  Relation "gc1" has no column "name"
! -- should work and drop the attribute in all tables
! alter table p2 drop column height;
! select relname, attname, attinhcount, attislocal
! from pg_class join pg_attribute on (pg_class.oid = pg_attribute.attrelid)
! where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
! order by relname, attnum;
!  relname | attname | attinhcount | attislocal
! ---------+---------+-------------+------------
!  c1      | id      |           1 | f
!  c1      | id2     |           1 | f
!  c1      | age     |           0 | t
!  gc1     | id      |           1 | f
!  gc1     | id2     |           1 | f
!  gc1     | age     |           1 | f
!  p1      | id      |           0 | t
!  p2      | id2     |           0 | t
! (8 rows)
!
! drop table p1, p2 cascade;
! NOTICE:  Drop cascades to table c1
! NOTICE:  Drop cascades to table gc1
--- 940,943 ----
  alter table atacc1 drop d;
  alter table atacc1 drop b;
  select * from atacc1;
! calloc: Invalid argument

======================================================================


pgsql-hackers by date:

Previous
From: Jinqiang Han
Date:
Subject: about postgresql-7.3.2 rpm
Next
From: Larry Rosenman
Date:
Subject: Re: Request for supported platforms