Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
0236b5e0
Commit
0236b5e0
authored
20 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
This patch adds an example to the CREATE DOMAIN docs.
David Fetter
parent
ff8d68df
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/ref/create_domain.sgml
+19
-5
19 additions, 5 deletions
doc/src/sgml/ref/create_domain.sgml
with
19 additions
and
5 deletions
doc/src/sgml/ref/create_domain.sgml
+
19
−
5
View file @
0236b5e0
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.1
7
200
3/11/29 19:51:38 pgsql
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.1
8
200
4/08/08 01:49:30 momjian
Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -160,11 +160,25 @@ where <replaceable class="PARAMETER">constraint</replaceable> is:
...
@@ -160,11 +160,25 @@ where <replaceable class="PARAMETER">constraint</replaceable> is:
<title>Examples</title>
<title>Examples</title>
<para>
<para>
This example creates the <type>country_code</type> data type and then uses the
This example creates the <type>us_postal_code</type> data type and
type in a table definition:
then uses the type in a table definition:
<programlisting>
<programlisting>
CREATE DOMAIN country_code char(2) NOT NULL;
CREATE DOMAIN us_postal_code AS TEXT
CREATE TABLE countrylist (id integer, country country_code);
NOT NULL
CHECK(
VALUE ~ $pc$^\d{5}$$pc$
OR VALUE ~ $pc$^\d{5}-\d{4}$$pc$
);
CREATE TABLE us_snail_addy (
address_id SERIAL NOT NULL PRIMARY KEY
, street1 TEXT NOT NULL
, street2 TEXT
, street3 TEXT
, city TEXT NOT NULL
, postal us_postal_code
);
</programlisting>
</programlisting>
</para>
</para>
</refsect1>
</refsect1>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment