Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03f1648

Browse files
committed
Attached is a patch with some fixes that (I think that) should go into
6.4.1. Here is the list:- The type int8 now works. In fact, the bug(s) were insrc/backend/port/snprintf.c, so int8 is probably broken in every platformthat hasn't a native snprintf/vsnprintf. The type itself worked asexpected, only the output was wrong. Anyway, this patch should be checkedin other platforms.- The regression tests for int2 and int4, which were broken due todifferences in the error messages, are fixed.- The regression test for float8, which was broken in the referenceplatform, is also fixed. I don't know if the new file (float8-OSF1.out)will work on other platforms, but it might be worth to try it.- Two new template files are provided (alpha_cc, which includesoptimization, and alpha_gcc), and src/templates/.similar is updatedaccordingly. src/templates/alpha should be removed from the distribution.*IMPORTANT NOTE*: I don't know if you can use gcc to compile postgres;I've written the alpha_gcc file because alpha_cc has some flags that arespecific to DEC C.- There is a (very basic) Digital Unix specific FAQ indoc/FAQ_DigitalUnix.---------------------------------------------------------------------Pedro José Lobo Perea Tel: +34 91 336 78 19
1 parent9d6f060 commit03f1648

File tree

6 files changed

+355
-3
lines changed

6 files changed

+355
-3
lines changed

‎doc/FAQ_DigitalUnix

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
=======================================================
2+
Frequently Asked Questions (FAQ) for PostgreSQL V6.4.1
3+
FreeBSD Specific
4+
TO BE READ IN CONJUNCTION WITH THE NORMAL FAQ
5+
=======================================================
6+
last updated: Mon Dec 14 17:26:03 CET 1998
7+
8+
current maintainer: Pedro J. Lobo (pjlobo@euitt.upm.es)
9+
original author: Pedro J. Lobo (pjlobo@euitt.upm.es)
10+
11+
This FAQ covers issues that are specific for PostgreSQL running on Digital
12+
Unix (formerly known as DEC OSF/1). Please check the global FAQ for questions
13+
not specific to this platform.
14+
15+
Changes in this version (* = modified, + = new, - = removed):
16+
17+
This file is divided approximately as follows:
18+
19+
1.*)Installing PostgreSQL
20+
21+
1.1.*)Compiling PostgreSQL
22+
23+
1.2.*)Running the regression tests
24+
25+
26+
Questions answered:
27+
1.1.1)I can't compile PostgreSQL with gcc.
28+
29+
1.1.2)DEC C dies with an internal error when optimization is
30+
enabled (-O flag).
31+
32+
1.2.1)The regression tests fail for char, varchar, select_implicit,
33+
select_having and rules.
34+
35+
1.2.2)The regression tests fail for abstime, tinterval and horology.
36+
37+
1.2.3)The regression tests fail for geometry.
38+
39+
1.2.4)The regression tests fail for inet.
40+
41+
----------------------------------------------------------------------
42+
Section 1: Installing PostgreSQL
43+
----------------------------------------------------------------------
44+
45+
Section 1.1:Compiling PostgreSQL
46+
------------------------------------
47+
48+
1.1.1)I can't compile PostgreSQL with gcc.
49+
50+
Me too O:-) I tried to compile it with gcc 2.7.2.1 without
51+
success. However, I've found that DEC C works much better than
52+
gcc for alphas, and so I didn't make any effort to find out
53+
why gcc fails. If you succedd on this task, please take the
54+
time to update this section (see http://www.postgresql.org for
55+
the details on how to do this).
56+
57+
1.1.2)The DEC C compiler dies with an internal error when optimization is
58+
enabled (-O flag).
59+
60+
I've seen this happening on 3.2c and 3.2g systems, and only on
61+
one of the source files (can't remember exactly which one).
62+
The workaround was to compile the offending module without
63+
optimization by hand, and re-running gmake to let the process
64+
continue.
65+
66+
It doesn't happen on 4.0d systems (mine at least). Don't know
67+
about earlier 4.0 versions.
68+
69+
Section 1.2:Running the regression tests
70+
--------------------------------------------
71+
72+
1.2.1)The regression tests fail for char, varchar, select_implicit,
73+
select_having and rules.
74+
75+
This only happens when you enable locale support, and is due
76+
to a bug in the system's locale libraries. The problem is
77+
that strcoll("Axxx", "axxx") returns a value greater than
78+
zero instead of lower, which is how it should be.
79+
80+
This isn't a great problem unless you (or your application)
81+
relies on upper-case letters being considered "smaller" than
82+
lower-case for ordering purposes. Otherwise, you will only
83+
notice that the ordering between upper-case and lower-case
84+
letters is reversed.
85+
86+
1.2.2)The regression tests fail for abstime, tinterval and horology.
87+
88+
I think that these failures are due to some inconsistencies
89+
in time zone handling in some years near 1950, in which case
90+
the problem would be in the operating system's time zone
91+
libraries. Recent dates seem to work as expected, but I can't
92+
assure it.
93+
94+
1.2.3)The regression tests fail for geometry.
95+
96+
These are (small) rounding errors that shouldn't affect any
97+
application (but could do, who knows).
98+
99+
1.2.4)The regression tests fail for inet.
100+
101+
Yes, they do. You must consider the inet type broken for
102+
Digital Unix.
103+

‎src/backend/port/snprintf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ typedef long long long_long;
7272
* causing nast effects.
7373
**************************************************************/
7474

75-
/*static char _id[] = "$Id: snprintf.c,v 1.13 1998/12/18 07:03:06 momjian Exp $";*/
75+
/*static char _id[] = "$Id: snprintf.c,v 1.14 1998/12/18 07:08:00 momjian Exp $";*/
7676
staticchar*end;
7777
staticintSnprfOverflow;
7878

@@ -349,7 +349,7 @@ intbase,
349349
zpad;
350350
{
351351
intsignvalue=0;
352-
#ifdefHAVE_LONG_INT_64
352+
#ifdefHAVE_LONG_LONG_INT_64
353353
unsignedlong_longuvalue;
354354
#else
355355
unsigned longuvalue;

‎src/template/.similar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
alpha-dec-osf=alpha
1+
alpha-dec-osf=alpha_cc
22
alpha-unknown-linux-gnu=linux_alpha
33
hppa1.1-hp-hpux=hpux_cc
44
hppa1.1-stratus-sysv4=svr4

‎src/template/alpha_cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
AROPT:crs
2+
# NOFIXADE disallows unaligned access.
3+
# on Ultrix and OSF/1 it invokes an explicit syscall.
4+
# on HP-UX it turns off certain compiler options.
5+
# This is defined here because a bunch of clients include tmp/c.h,
6+
# which is where the work is done on HP-UX. It only affects the
7+
# backend on Ultrix and OSF/1.
8+
CFLAGS:-DNOFIXADE -std -O4 -Olimit 2000
9+
SHARED_LIB:
10+
ALL:
11+
SRCH_INC:
12+
SRCH_LIB:
13+
DLSUFFIX:.so
14+
YFLAGS:-d
15+
YACC:
File renamed without changes.
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
QUERY: CREATE TABLE FLOAT8_TBL(f1 float8);
2+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
3+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
4+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
5+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
6+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
7+
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
8+
five|f1
9+
----+--------------------
10+
|0
11+
|1004.3
12+
|-34.84
13+
|1.2345678901234e+200
14+
|1.2345678901234e-200
15+
(5 rows)
16+
17+
QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
18+
four|f1
19+
----+--------------------
20+
|0
21+
|-34.84
22+
|1.2345678901234e+200
23+
|1.2345678901234e-200
24+
(4 rows)
25+
26+
QUERY: SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
27+
one| f1
28+
---+------
29+
|1004.3
30+
(1 row)
31+
32+
QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
33+
three| f1
34+
-----+--------------------
35+
| 0
36+
| -34.84
37+
|1.2345678901234e-200
38+
(3 rows)
39+
40+
QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
41+
three| f1
42+
-----+--------------------
43+
| 0
44+
| -34.84
45+
|1.2345678901234e-200
46+
(3 rows)
47+
48+
QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
49+
four| f1
50+
----+--------------------
51+
| 0
52+
| 1004.3
53+
| -34.84
54+
|1.2345678901234e-200
55+
(4 rows)
56+
57+
QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
58+
four| f1
59+
----+--------------------
60+
| 0
61+
| 1004.3
62+
| -34.84
63+
|1.2345678901234e-200
64+
(4 rows)
65+
66+
QUERY: SELECT '' AS three, f.f1, f.f1 * '-10' AS x
67+
FROM FLOAT8_TBL f
68+
WHERE f.f1 > '0.0';
69+
three|f1 |x
70+
-----+--------------------+---------------------
71+
|1004.3 |-10043
72+
|1.2345678901234e+200|-1.2345678901234e+201
73+
|1.2345678901234e-200|-1.2345678901234e-199
74+
(3 rows)
75+
76+
QUERY: SELECT '' AS three, f.f1, f.f1 + '-10' AS x
77+
FROM FLOAT8_TBL f
78+
WHERE f.f1 > '0.0';
79+
three|f1 |x
80+
-----+--------------------+--------------------
81+
|1004.3 |994.3
82+
|1.2345678901234e+200|1.2345678901234e+200
83+
|1.2345678901234e-200|-10
84+
(3 rows)
85+
86+
QUERY: SELECT '' AS three, f.f1, f.f1 / '-10' AS x
87+
FROM FLOAT8_TBL f
88+
WHERE f.f1 > '0.0';
89+
three|f1 |x
90+
-----+--------------------+---------------------
91+
|1004.3 |-100.43
92+
|1.2345678901234e+200|-1.2345678901234e+199
93+
|1.2345678901234e-200|-1.2345678901234e-201
94+
(3 rows)
95+
96+
QUERY: SELECT '' AS three, f.f1, f.f1 - '-10' AS x
97+
FROM FLOAT8_TBL f
98+
WHERE f.f1 > '0.0';
99+
three|f1 |x
100+
-----+--------------------+--------------------
101+
|1004.3 |1014.3
102+
|1.2345678901234e+200|1.2345678901234e+200
103+
|1.2345678901234e-200|10
104+
(3 rows)
105+
106+
QUERY: SELECT '' AS one, f.f1 ^ '2.0' AS square_f1
107+
FROM FLOAT8_TBL f where f.f1 = '1004.3';
108+
one| square_f1
109+
---+----------
110+
|1008618.49
111+
(1 row)
112+
113+
QUERY: SELECT '' AS five, f.f1, @f.f1 AS abs_f1
114+
FROM FLOAT8_TBL f;
115+
five|f1 |abs_f1
116+
----+--------------------+--------------------
117+
|0 |0
118+
|1004.3 |1004.3
119+
|-34.84 |34.84
120+
|1.2345678901234e+200|1.2345678901234e+200
121+
|1.2345678901234e-200|1.2345678901234e-200
122+
(5 rows)
123+
124+
QUERY: SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
125+
FROM FLOAT8_TBL f;
126+
five|f1 |trunc_f1
127+
----+--------------------+--------------------
128+
|0 |0
129+
|1004.3 |1004
130+
|-34.84 |-34
131+
|1.2345678901234e+200|1.2345678901234e+200
132+
|1.2345678901234e-200|0
133+
(5 rows)
134+
135+
QUERY: SELECT '' AS five, f.f1, f.f1 % AS round_f1
136+
FROM FLOAT8_TBL f;
137+
five|f1 |round_f1
138+
----+--------------------+--------------------
139+
|0 |0
140+
|1004.3 |1004
141+
|-34.84 |-35
142+
|1.2345678901234e+200|1.2345678901234e+200
143+
|1.2345678901234e-200|0
144+
(5 rows)
145+
146+
QUERY: SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
147+
FROM FLOAT8_TBL f
148+
WHERE f.f1 > '0.0';
149+
three|f1 |sqrt_f1
150+
-----+--------------------+---------------------
151+
|1004.3 |31.6906926399535
152+
|1.2345678901234e+200|1.11111110611109e+100
153+
|1.2345678901234e-200|1.11111110611109e-100
154+
(3 rows)
155+
156+
QUERY: SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
157+
FROM FLOAT8_TBL f
158+
WHERE f.f1 > '0.0';
159+
three|f1 |exp_ln_f1
160+
-----+--------------------+---------------------
161+
|1004.3 |1004.3
162+
|1.2345678901234e+200|1.23456789012338e+200
163+
|1.2345678901234e-200|1.23456789012339e-200
164+
(3 rows)
165+
166+
QUERY: SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
167+
five|f1 |cbrt_f1
168+
----+--------------------+--------------------
169+
|0 |0
170+
|1004.3 |10.014312837827
171+
|-34.84 |-3.26607421344208
172+
|1.2345678901234e+200|4.97933859234765e+66
173+
|1.2345678901234e-200|2.3112042409018e-67
174+
(5 rows)
175+
176+
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
177+
five|f1
178+
----+--------------------
179+
|0
180+
|1004.3
181+
|-34.84
182+
|1.2345678901234e+200
183+
|1.2345678901234e-200
184+
(5 rows)
185+
186+
QUERY: UPDATE FLOAT8_TBL
187+
SET f1 = FLOAT8_TBL.f1 * '-1'
188+
WHERE FLOAT8_TBL.f1 > '0.0';
189+
QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
190+
ERROR: floating point exception! The last floating point operation either exceeded legal ranges or was a divide by zero
191+
QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
192+
ERROR: pow() result is out of range
193+
QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
194+
ERROR: can't take log of zero
195+
QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
196+
ERROR: can't take log of a negative number
197+
QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
198+
ERROR: exp() result is out of range
199+
QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
200+
ERROR: float8div: divide by zero error
201+
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
202+
five|f1
203+
----+---------------------
204+
|0
205+
|-34.84
206+
|-1004.3
207+
|-1.2345678901234e+200
208+
|-1.2345678901234e-200
209+
(5 rows)
210+
211+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
212+
ERROR: Bad float8 input format '10e400'
213+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
214+
ERROR: Bad float8 input format '-10e400'
215+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
216+
ERROR: Bad float8 input format '10e-400'
217+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
218+
ERROR: Bad float8 input format '-10e-400'
219+
QUERY: DELETE FROM FLOAT8_TBL;
220+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
221+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
222+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
223+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
224+
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
225+
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
226+
five|f1
227+
----+---------------------
228+
|0
229+
|-34.84
230+
|-1004.3
231+
|-1.2345678901234e+200
232+
|-1.2345678901234e-200
233+
(5 rows)
234+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp