Re: [HACKERS] help bug and comment char.

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: terry(at)terrym(dot)com (Terry Mackintosh)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] help bug and comment char.
Date: 1999-02-02 18:40:08
Message-ID: 199902021840.NAA28670@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Hi all
>
> In looking for how to do table constraints psql help says:
>
> software=> \h create table
> Command: create table
> Description: create a new table
> Syntax:
> CREATE TABLE class_name
> (attr1 type1 [DEFAULT expression] [NOT NULL], ...attrN)
> [INHERITS (class_name1, ...class_nameN)
> [[CONSTRAINT name] CHECK condition1, ...conditionN] ]
> ;
>
>
> But this both does not work, and does not agree with "The Practical SQL
> Handbook", the examples of which do work.
>
> Should the syntax not be more like: (constraint inside the main parens)
>
> Command: create table
> Description: create a new table
> Syntax:
> CREATE TABLE class_name
> (attr1 type1 [DEFAULT expression] [NOT NULL][, ...attrN]
> [,[CONSTRAINT name] CHECK condition1, ...conditionN] ]);

Fixed.

>
> I'm not sure where to put:
> [INHERITS (class_name1, ...class_nameN)
> as I've never used it. But I suspect it may need inside the '()' as well,
> no?
>
> OH, also, what is / is there, a comment character to use in SQL scripts
> feed into psql?

-- is the comment character. Man sql says:

---------------------------------------------------------------------------

Comments
A comment is an arbitrary sequence of characters following
double dashes up to the end of the line. We also support
double-slashes as comments, e.g.:
-- This is a standard SQL comment
// And this is another supported comment style, like C++

We also support C-style comments, e.g.:
/* multi
line
comment */

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-02-02 18:42:10 Re: [HACKERS] help bug and comment char.
Previous Message Bruce Momjian 1999-02-02 18:36:11 Re: [HACKERS] Adding some const keywords to external interfaces