1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Remove useless whitespace at end of lines

This commit is contained in:
Peter Eisentraut
2010-11-23 22:27:50 +02:00
parent 44475e782f
commit fc946c39ae
517 changed files with 3463 additions and 3508 deletions

View File

@ -17,7 +17,7 @@
-- descendants.
-----------------------------
-- For example, the capitals table inherits from cities table. (It inherits
-- For example, the capitals table inherits from cities table. (It inherits
-- all data fields from cities.)
CREATE TABLE cities (

View File

@ -31,17 +31,17 @@ CREATE TABLE cities (
-----------------------------
-- Populating a Table With Rows:
-- An INSERT statement is used to insert a new row into a table. There
-- An INSERT statement is used to insert a new row into a table. There
-- are several ways you can specify what columns the data should go to.
-----------------------------
-- 1. The simplest case is when the list of value correspond to the order of
-- the columns specified in CREATE TABLE.
INSERT INTO weather
INSERT INTO weather
VALUES ('San Francisco', 46, 50, 0.25, '1994-11-27');
INSERT INTO cities
INSERT INTO cities
VALUES ('San Francisco', '(-194.0, 53.0)');
-- 2. You can also specify what column the values correspond to. (The columns
@ -76,7 +76,7 @@ SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;
SELECT *
FROM weather
WHERE city = 'San Francisco'
WHERE city = 'San Francisco'
AND prcp > 0.0;
-- Here is a more complicated one. Duplicates are removed when DISTINCT is
@ -128,10 +128,10 @@ SELECT *
-- Suppose we want to find all the records that are in the temperature range
-- of other records. W1 and W2 are aliases for weather.
SELECT W1.city, W1.temp_lo, W1.temp_hi,
SELECT W1.city, W1.temp_lo, W1.temp_hi,
W2.city, W2.temp_lo, W2.temp_hi
FROM weather W1, weather W2
WHERE W1.temp_lo < W2.temp_lo
WHERE W1.temp_lo < W2.temp_lo
and W1.temp_hi > W2.temp_hi;
@ -147,7 +147,7 @@ SELECT city FROM weather
-- Aggregate with GROUP BY
SELECT city, max(temp_lo)
FROM weather
FROM weather
GROUP BY city;
-- ... and HAVING
@ -185,7 +185,7 @@ DELETE FROM weather WHERE city = 'Hayward';
SELECT * FROM weather;
-- You can also delete all the rows in a table by doing the following. (This
-- is different from DROP TABLE which removes the table in addition to the
-- is different from DROP TABLE which removes the table in addition to the
-- removing the rows.)
DELETE FROM weather;

View File

@ -3,7 +3,7 @@
-- complex.sql-
-- This file shows how to create a new user-defined type and how to
-- use this new type.
--
--
--
-- Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
-- Portions Copyright (c) 1994, Regents of the University of California
@ -28,7 +28,7 @@
-- C code. We also mark them IMMUTABLE, since they always return the
-- same outputs given the same inputs.
-- the input function 'complex_in' takes a null-terminated string (the
-- the input function 'complex_in' takes a null-terminated string (the
-- textual representation of the type) and turns it into the internal
-- (in memory) representation. You will get a message telling you 'complex'
-- does not exist yet but that's okay.
@ -67,7 +67,7 @@ CREATE FUNCTION complex_send(complex)
-- memory block required to hold the type (we need two 8-byte doubles).
CREATE TYPE complex (
internallength = 16,
internallength = 16,
input = complex_in,
output = complex_out,
receive = complex_recv,
@ -89,7 +89,7 @@ CREATE TABLE test_complex (
);
-- data for user-defined types are just strings in the proper textual
-- representation.
-- representation.
INSERT INTO test_complex VALUES ('(1.0, 2.5)', '(4.2, 3.55 )');
INSERT INTO test_complex VALUES ('(33.0, 51.4)', '(100.42, 93.55)');
@ -100,7 +100,7 @@ SELECT * FROM test_complex;
-- Creating an operator for the new type:
-- Let's define an add operator for complex types. Since POSTGRES
-- supports function overloading, we'll use + as the add operator.
-- (Operator names can be reused with different numbers and types of
-- (Operator names can be reused with different numbers and types of
-- arguments.)
-----------------------------
@ -112,7 +112,7 @@ CREATE FUNCTION complex_add(complex, complex)
-- we can now define the operator. We show a binary operator here but you
-- can also define unary operators by omitting either of leftarg or rightarg.
CREATE OPERATOR + (
CREATE OPERATOR + (
leftarg = complex,
rightarg = complex,
procedure = complex_add,

View File

@ -18,14 +18,14 @@
-----------------------------
--
-- let's create a simple SQL function that takes no arguments and
-- let's create a simple SQL function that takes no arguments and
-- returns 1
CREATE FUNCTION one() RETURNS integer
AS 'SELECT 1 as ONE' LANGUAGE SQL;
--
-- functions can be used in any expressions (eg. in the target list or
-- functions can be used in any expressions (eg. in the target list or
-- qualifications)
SELECT one() AS answer;
@ -61,7 +61,7 @@ INSERT INTO EMP VALUES ('Andy', -1000, 2, '(1,3)');
INSERT INTO EMP VALUES ('Bill', 4200, 36, '(2,1)');
INSERT INTO EMP VALUES ('Ginger', 4800, 30, '(2,4)');
-- the argument of a function can also be a tuple. For instance,
-- the argument of a function can also be a tuple. For instance,
-- double_salary takes a tuple of the EMP table
CREATE FUNCTION double_salary(EMP) RETURNS integer
@ -71,8 +71,8 @@ SELECT name, double_salary(EMP) AS dream
FROM EMP
WHERE EMP.cubicle ~= '(2,1)'::point;
-- the return value of a function can also be a tuple. However, make sure
-- that the expressions in the target list is in the same order as the
-- the return value of a function can also be a tuple. However, make sure
-- that the expressions in the target list is in the same order as the
-- columns of EMP.
CREATE FUNCTION new_emp() RETURNS EMP
@ -121,7 +121,7 @@ SELECT name(high_pay()) AS overpaid;
-----------------------------
-- Creating C Functions
-- in addition to SQL functions, you can also create C functions.
-- in addition to SQL functions, you can also create C functions.
-- See funcs.c for the definition of the C functions.
-----------------------------
@ -144,7 +144,7 @@ SELECT makepoint('(1,2)'::point, '(3,4)'::point ) AS newpoint;
SELECT copytext('hello world!');
SELECT name, c_overpaid(EMP, 1500) AS overpaid
FROM EMP
FROM EMP
WHERE name = 'Bill' or name = 'Sam';
-- remove functions that were created in this file

View File

@ -42,8 +42,8 @@ SELECT n.nspname, c.relname
-- column reference)
--
SELECT n.nspname AS schema_name,
bc.relname AS class_name,
ic.relname AS index_name,
bc.relname AS class_name,
ic.relname AS index_name,
a.attname
FROM pg_namespace n,
pg_class bc, -- base class
@ -64,7 +64,7 @@ SELECT n.nspname AS schema_name,
-- classes
--
SELECT n.nspname, c.relname, a.attname, format_type(t.oid, null) as typname
FROM pg_namespace n, pg_class c,
FROM pg_namespace n, pg_class c,
pg_attribute a, pg_type t
WHERE n.oid = c.relnamespace
and c.relkind = 'r' -- no indices
@ -94,10 +94,10 @@ SELECT n.nspname, r.rolname, format_type(t.oid, null) as typname
--
-- lists all left unary operators
--
SELECT n.nspname, o.oprname AS left_unary,
SELECT n.nspname, o.oprname AS left_unary,
format_type(right_type.oid, null) AS operand,
format_type(result.oid, null) AS return_type
FROM pg_namespace n, pg_operator o,
FROM pg_namespace n, pg_operator o,
pg_type right_type, pg_type result
WHERE o.oprnamespace = n.oid
and o.oprkind = 'l' -- left unary
@ -109,10 +109,10 @@ SELECT n.nspname, o.oprname AS left_unary,
--
-- lists all right unary operators
--
SELECT n.nspname, o.oprname AS right_unary,
SELECT n.nspname, o.oprname AS right_unary,
format_type(left_type.oid, null) AS operand,
format_type(result.oid, null) AS return_type
FROM pg_namespace n, pg_operator o,
FROM pg_namespace n, pg_operator o,
pg_type left_type, pg_type result
WHERE o.oprnamespace = n.oid
and o.oprkind = 'r' -- right unary
@ -127,7 +127,7 @@ SELECT n.nspname, o.oprname AS binary_op,
format_type(left_type.oid, null) AS left_opr,
format_type(right_type.oid, null) AS right_opr,
format_type(result.oid, null) AS return_type
FROM pg_namespace n, pg_operator o, pg_type left_type,
FROM pg_namespace n, pg_operator o, pg_type left_type,
pg_type right_type, pg_type result
WHERE o.oprnamespace = n.oid
and o.oprkind = 'b' -- binary
@ -142,12 +142,12 @@ SELECT n.nspname, o.oprname AS binary_op,
-- C functions
--
SELECT n.nspname, p.proname, p.pronargs, format_type(t.oid, null) as return_type
FROM pg_namespace n, pg_proc p,
FROM pg_namespace n, pg_proc p,
pg_language l, pg_type t
WHERE p.pronamespace = n.oid
and n.nspname not like 'pg\\_%' -- no catalogs
and n.nspname != 'information_schema' -- no information_schema
and p.prolang = l.oid
and p.prolang = l.oid
and p.prorettype = t.oid
and l.lanname = 'c'
ORDER BY nspname, proname, pronargs, return_type;
@ -156,7 +156,7 @@ SELECT n.nspname, p.proname, p.pronargs, format_type(t.oid, null) as return_type
-- lists all aggregate functions and the types to which they can be applied
--
SELECT n.nspname, p.proname, format_type(t.oid, null) as typname
FROM pg_namespace n, pg_aggregate a,
FROM pg_namespace n, pg_aggregate a,
pg_proc p, pg_type t
WHERE p.pronamespace = n.oid
and a.aggfnoid = p.oid
@ -170,7 +170,7 @@ SELECT n.nspname, p.proname, format_type(t.oid, null) as typname
-- families
--
SELECT am.amname, n.nspname, opf.opfname, opr.oprname
FROM pg_namespace n, pg_am am, pg_opfamily opf,
FROM pg_namespace n, pg_am am, pg_opfamily opf,
pg_amop amop, pg_operator opr
WHERE opf.opfnamespace = n.oid
and opf.opfmethod = am.oid