diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index f3a0129778..e43630f25b 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -1,4 +1,4 @@ - + Data Definition @@ -240,7 +240,7 @@ CREATE TABLE products ( in a table. For many applications, however, the constraint they provide is too coarse. For example, a column containing a product price should probably only accept positive values. But there is no - data type that accepts only positive numbers. Another issue is + standard data type that accepts only positive numbers. Another issue is that you might want to constrain column data with respect to other columns or rows. For example, in a table containing product information, there should only be one row for each product number. @@ -431,7 +431,7 @@ CREATE TABLE products ( IS NOT NULL), but in PostgreSQL creating an explicit not-null constraint is more efficient. The drawback is that you - cannot give explicit names to not-null constraints created that + cannot give explicit names to not-null constraints created this way. @@ -551,7 +551,7 @@ CREATE TABLE products ( columns included in the constraint are equal. However, null values are not considered equal in this comparison. That means even in the presence of a - unique constraint it is possible to store an unlimited number of + unique constraint it is possible to store duplicate rows that contain a null value in at least one of the constrained columns. This behavior conforms to the SQL standard, but we have heard that other SQL databases may not follow this rule. So be diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index ae6ae9468d..135fe7aca8 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1,5 +1,5 @@ @@ -260,7 +260,7 @@ UPDATE "my_table" SET "a" = 5; \n is a newline, \r is a carriage return, \t is a tab. Also supported is \digits, where - ddd represents an octal byte value, and + digits represents an octal byte value, and \xhexdigits, where hexdigits represents a hexadecimal byte value. (It is your responsibility that the byte sequences you create are @@ -544,6 +544,16 @@ CAST ( 'string' AS type ) is that it does not work for array types; use :: or CAST() to specify the type of an array constant. + + + The CAST() syntax conforms to SQL. The + type 'string' + syntax is a generalization of the standard: SQL specifies this syntax only + for a few datatypes, but PostgreSQL allows it + for all types. The syntax with + :: is historical PostgreSQL + usage, as is the function-call syntax. + @@ -1105,8 +1115,8 @@ CREATE FUNCTION dept(text) RETURNS dept LANGUAGE SQL; - Here the $1 will be replaced by the first - function argument when the function is invoked. + Here the $1 references the value of the first + function argument whenever the function is invoked.