
Okay, after feeling stupid about the last one (altho I hadn't thought to
read the CREATE INDEX page, only the CREATE SCHEMA one), I really hate to
ask this one ... but ... is this documented somewhere also:

CREATE SCHEMA company_00244
  CREATE TABLE traffic ( ip_id int4, port int4, bytes bigint, runtime timestamp )
  CREATE INDEX traffic_dist ON traffic USING BTREE ( ip_id, port )
  CREATE INDEX traffic_time ON traffic USING btree ( hour_trunc(runtime));

ERROR:  parser: parse error at or near "INDEX" at character 122

or, is there an obvious error that I'm just not seeing?

The CREATE SCHEMA page shows CREATE TABLE and CREATE VIEW, so should I
consider CREATE INDEX no supported since it wasn't part of the example?



Wed, 15 Oct 2003 17:00:54 -0300 (ADT)
"Marc G. Fournier" <scrappy@hub.org>
Second question on schemas and INDEX(es) ...
On Wed, 2003-10-15 at 16:00, Marc G. Fournier wrote:
> 
> Okay, after feeling stupid about the last one (altho I hadn't thought to
> read the CREATE INDEX page, only the CREATE SCHEMA one), I really hate to
> ask this one ... but ... is this documented somewhere also:
> 
> CREATE SCHEMA company_00244
>   CREATE TABLE traffic ( ip_id int4, port int4, bytes bigint, runtime timestamp )
>   CREATE INDEX traffic_dist ON traffic USING BTREE ( ip_id, port )
>   CREATE INDEX traffic_time ON traffic USING btree ( hour_trunc(runtime));
> 
> ERROR:  parser: parse error at or near "INDEX" at character 122
> 
> or, is there an obvious error that I'm just not seeing?
> 
> The CREATE SCHEMA page shows CREATE TABLE and CREATE VIEW, so should I
> consider CREATE INDEX no supported since it wasn't part of the example?
>

If I'm right your having a heck of a bad day, but I believe the problem
is you have no ; after each of your sql statements...

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


15 Oct 2003 16:20:56 -0400
Robert Treat <xzilla@users.sourceforge.net>
Re: Second question on schemas and INDEX(es) ...
On Wed, 15 Oct 2003, Marc G. Fournier wrote:

> Okay, after feeling stupid about the last one (altho I hadn't thought to
> read the CREATE INDEX page, only the CREATE SCHEMA one), I really hate to
> ask this one ... but ... is this documented somewhere also:

CREATE INDEX isn't currently a "schema_element" I believe.

 From CREATE SCHEMA:
"An SQL statement defining an object to be created within the schema.
Currently, only CREATE TABLE, CREATE VIEW, and GRANT are accepted as
clauses within CREATE SCHEMA. Other kinds of objects may be created in
separate commands after the schema is created."

Wed, 15 Oct 2003 13:21:26 -0700 (PDT)
Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: Second question on schemas and INDEX(es) ...
Marc G. Fournier wrote:

>Okay, after feeling stupid about the last one (altho I hadn't thought to
>read the CREATE INDEX page, only the CREATE SCHEMA one), I really hate to
>ask this one ... but ... is this documented somewhere also:
>
>CREATE SCHEMA company_00244
>  CREATE TABLE traffic ( ip_id int4, port int4, bytes bigint, runtime timestamp )
>  CREATE INDEX traffic_dist ON traffic USING BTREE ( ip_id, port )
>  CREATE INDEX traffic_time ON traffic USING btree ( hour_trunc(runtime));
>
>ERROR:  parser: parse error at or near "INDEX" at character 122
>
>or, is there an obvious error that I'm just not seeing?
>
>The CREATE SCHEMA page shows CREATE TABLE and CREATE VIEW, so should I
>consider CREATE INDEX no supported since it wasn't part of the example?
>
>  
>
Again the manual is your friend ... create schema says:

/schema_element/

    An SQL statement defining an object to be created within the schema.
    Currently, only CREATE TABLE, CREATE VIEW, and GRANT are accepted as
    clauses within CREATE SCHEMA. Other kinds of objects may be created
    in separate commands after the schema is created

    cheers

    andrew




Wed, 15 Oct 2003 16:29:57 -0400
Andrew Dunstan <andrew@dunslane.net>
Re: Second question on schemas and INDEX(es) ...
On Wed, 2003-10-15 at 16:20, Robert Treat wrote:
> On Wed, 2003-10-15 at 16:00, Marc G. Fournier wrote:
> > 
> > Okay, after feeling stupid about the last one (altho I hadn't thought to
> > read the CREATE INDEX page, only the CREATE SCHEMA one), I really hate to
> > ask this one ... but ... is this documented somewhere also:
> > 
> > CREATE SCHEMA company_00244
> >   CREATE TABLE traffic ( ip_id int4, port int4, bytes bigint, runtime timestamp )
> >   CREATE INDEX traffic_dist ON traffic USING BTREE ( ip_id, port )
> >   CREATE INDEX traffic_time ON traffic USING btree ( hour_trunc(runtime));
> > 
> > ERROR:  parser: parse error at or near "INDEX" at character 122
> > 
> > or, is there an obvious error that I'm just not seeing?
> > 
> > The CREATE SCHEMA page shows CREATE TABLE and CREATE VIEW, so should I
> > consider CREATE INDEX no supported since it wasn't part of the example?
> >
> 
> If I'm right your having a heck of a bad day, but I believe the problem
> is you have no ; after each of your sql statements...
> 

Not that bad I guess ;-)  I missed what you were trying to do, but
Stephen's email is on target.  Note you can do in multiple statements
though...

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


15 Oct 2003 16:34:04 -0400
Robert Treat <xzilla@users.sourceforge.net>
Re: Second question on schemas and INDEX(es) ...


On Wed, 15 Oct 2003, Stephan Szabo wrote:

> On Wed, 15 Oct 2003, Marc G. Fournier wrote:
>
> > Okay, after feeling stupid about the last one (altho I hadn't thought to
> > read the CREATE INDEX page, only the CREATE SCHEMA one), I really hate to
> > ask this one ... but ... is this documented somewhere also:
>
> CREATE INDEX isn't currently a "schema_element" I believe.
>
> From CREATE SCHEMA:
> "An SQL statement defining an object to be created within the schema.
> Currently, only CREATE TABLE, CREATE VIEW, and GRANT are accepted as
> clauses within CREATE SCHEMA. Other kinds of objects may be created in
> separate commands after the schema is created."

Damn, I really have to go take another English course ... *sigh*

Wed, 15 Oct 2003 17:44:31 -0300 (ADT)
"Marc G. Fournier" <scrappy@postgresql.org>
Re: Second question on schemas and INDEX(es) ...