1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.128.2.7 2008/01/02 19:53:15 mha Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.128.2.8 2010/07/03 04:03:46 tgl Exp $
3
3
-->
4
4
5
5
<chapter id="datatype">
@@ -2325,7 +2325,7 @@ SELECT * FROM test1 WHERE a;
2325
2325
2326
2326
<para>
2327
2327
A rich set of functions and operators is available to perform various geometric
2328
- operations such as scaling, translation, rotation, and determining
2328
+ operations such as scaling, translation, rotation, and determining
2329
2329
intersections. They are explained in <xref linkend="functions-geometry">.
2330
2330
</para>
2331
2331
@@ -2337,8 +2337,9 @@ SELECT * FROM test1 WHERE a;
2337
2337
</indexterm>
2338
2338
2339
2339
<para>
2340
- Points are the fundamental two-dimensional building block for geometric types.
2341
- Values of type <type>point</type> are specified using the following syntax:
2340
+ Points are the fundamental two-dimensional building block for geometric
2341
+ types. Values of type <type>point</type> are specified using either of
2342
+ the following syntaxes:
2342
2343
2343
2344
<synopsis>
2344
2345
( <replaceable>x</replaceable> , <replaceable>y</replaceable> )
@@ -2348,6 +2349,10 @@ SELECT * FROM test1 WHERE a;
2348
2349
where <replaceable>x</> and <replaceable>y</> are the respective
2349
2350
coordinates as floating-point numbers.
2350
2351
</para>
2352
+
2353
+ <para>
2354
+ Points are output using the first syntax.
2355
+ </para>
2351
2356
</sect2>
2352
2357
2353
2358
<sect2>
@@ -2363,11 +2368,13 @@ SELECT * FROM test1 WHERE a;
2363
2368
2364
2369
<para>
2365
2370
Line segments (<type>lseg</type>) are represented by pairs of points.
2366
- Values of type <type>lseg</type> are specified using the following syntax:
2371
+ Values of type <type>lseg</type> are specified using any of the following
2372
+ syntaxes:
2367
2373
2368
2374
<synopsis>
2375
+ [ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) ]
2369
2376
( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) )
2370
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> )
2377
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> )
2371
2378
<replaceable>x1</replaceable> , <replaceable>y1</replaceable> , <replaceable>x2</replaceable> , <replaceable>y2</replaceable>
2372
2379
</synopsis>
2373
2380
@@ -2377,6 +2384,10 @@ SELECT * FROM test1 WHERE a;
2377
2384
<literal>(<replaceable>x2</replaceable>,<replaceable>y2</replaceable>)</literal>
2378
2385
are the end points of the line segment.
2379
2386
</para>
2387
+
2388
+ <para>
2389
+ Line segments are output using the first syntax.
2390
+ </para>
2380
2391
</sect2>
2381
2392
2382
2393
<sect2>
@@ -2393,7 +2404,8 @@ SELECT * FROM test1 WHERE a;
2393
2404
<para>
2394
2405
Boxes are represented by pairs of points that are opposite
2395
2406
corners of the box.
2396
- Values of type <type>box</type> is specified using the following syntax:
2407
+ Values of type <type>box</type> are specified using any of the following
2408
+ syntaxes:
2397
2409
2398
2410
<synopsis>
2399
2411
( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) )
@@ -2409,11 +2421,13 @@ SELECT * FROM test1 WHERE a;
2409
2421
</para>
2410
2422
2411
2423
<para>
2412
- Boxes are output using the first syntax.
2413
- The corners are reordered on input to store
2414
- the upper right corner, then the lower left corner.
2415
- Other corners of the box can be entered, but the lower
2416
- left and upper right corners are determined from the input and stored corners.
2424
+ Boxes are output using the second syntax.
2425
+ </para>
2426
+
2427
+ <para>
2428
+ Any two opposite corners can be supplied on input, but the values
2429
+ will be reordered as needed to store the
2430
+ upper right and lower left corners, in that order.
2417
2431
</para>
2418
2432
</sect2>
2419
2433
@@ -2440,20 +2454,22 @@ SELECT * FROM test1 WHERE a;
2440
2454
</para>
2441
2455
2442
2456
<para>
2443
- Values of type <type>path</type> are specified using the following syntax:
2457
+ Values of type <type>path</type> are specified using any of the following
2458
+ syntaxes:
2444
2459
2445
2460
<synopsis>
2446
- ( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) )
2447
2461
[ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) ]
2448
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
2449
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
2450
- <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable>
2462
+ ( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) )
2463
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
2464
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
2465
+ <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable>
2451
2466
</synopsis>
2452
2467
2453
2468
where the points are the end points of the line segments
2454
2469
comprising the path. Square brackets (<literal>[]</>) indicate
2455
2470
an open path, while parentheses (<literal>()</>) indicate a
2456
- closed path.
2471
+ closed path. When the outermost parentheses are omitted, as
2472
+ in the third through fifth syntaxes, a closed path is assumed.
2457
2473
</para>
2458
2474
2459
2475
<para>
@@ -2475,7 +2491,8 @@ SELECT * FROM test1 WHERE a;
2475
2491
</para>
2476
2492
2477
2493
<para>
2478
- Values of type <type>polygon</type> are specified using the following syntax:
2494
+ Values of type <type>polygon</type> are specified using any of the
2495
+ following syntaxes:
2479
2496
2480
2497
<synopsis>
2481
2498
( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) )
@@ -2502,7 +2519,8 @@ SELECT * FROM test1 WHERE a;
2502
2519
2503
2520
<para>
2504
2521
Circles are represented by a center point and a radius.
2505
- Values of type <type>circle</type> are specified using the following syntax:
2522
+ Values of type <type>circle</type> are specified using any of the
2523
+ following syntaxes:
2506
2524
2507
2525
<synopsis>
2508
2526
< ( <replaceable>x</replaceable> , <replaceable>y</replaceable> ) , <replaceable>r</replaceable> >
@@ -2512,8 +2530,9 @@ SELECT * FROM test1 WHERE a;
2512
2530
</synopsis>
2513
2531
2514
2532
where
2515
- <literal>(<replaceable>x</replaceable>,<replaceable>y</replaceable>)</literal>
2516
- is the center and <replaceable>r</replaceable> is the radius of the circle.
2533
+ <literal>(<replaceable>x</replaceable>,<replaceable>y</replaceable>)</>
2534
+ is the center and <replaceable>r</replaceable> is the radius of the
2535
+ circle.
2517
2536
</para>
2518
2537
2519
2538
<para>