[GRASS5] Re: [bug #3368] (grass) v.db.addcol manual - what column

this bug's URL: http://intevation.de/rt/webrt?serial_num=3368
Subject: v.db.addcol manual - what column types?

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: cvs 21.06.2005

columns=string
name and type of the new columns (ex: col1 type1, col2 type2)

is not informative. I still can't create new columns because I don't know
what
are the types allowed and how to input them here. I bet not only me. So a
short note what data types are recognized by Grass and how to call them
would
do much help. Or maybe that could go to "sql notes"?

L Moritz Lenert
L I agree that this should be documented.
L Radim, are all types supported by the respective backends supported by
GRASS ?
L If that is the case we could at least insert links to the different
backend's
L websites...
L Moritz

B - Radim Blazek
B The types depend on database which is used.

Facts
1 dbf is a default database driver in Grass, which means that it is most
likely to be used

2 it is almost sure that a Grass newbie will first use the dbf

3 dbf-based examples are most common in Grass manuals (14 manuals,
postgres -10)

4 dbf is the only driver mentioned in "sqlnotes"

... yet the user who wants to start using dbf driver is not informed what
kind of data types are supported.

4 Shapefile, which uses dbf, is widely used for data exchange. In particular
a Grass newbie who is migrating his data from other GIS is very likely to
use Shapefile. Thus the likelyhood of dbf-related problems and doubts
increases.

5 Could we assume that if somebody is using psql or other advanced database
then he automatically knows enough about it all so that he doesn't have such
basic problems? If so, we could conclude that such a basic guiding is only
needed for dbmi amateurs (like me), who are using the default dbf driver.

Maciek

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maciek Sieczka wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=3368
Subject: v.db.addcol manual - what column types?

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: cvs 21.06.2005

columns=string
name and type of the new columns (ex: col1 type1, col2 type2)

is not informative. I still can't create new columns because I don't
know
what
are the types allowed and how to input them here. I bet not only me.
So a
short note what data types are recognized by Grass and how to call them
would
do much help. Or maybe that could go to "sql notes"?

L Moritz Lenert
L I agree that this should be documented.
L Radim, are all types supported by the respective backends supported by
GRASS ?
L If that is the case we could at least insert links to the different
backend's
L websites...
L Moritz

B - Radim Blazek
B The types depend on database which is used.

Facts
1 dbf is a default database driver in Grass, which means that it is most
likely to be used

2 it is almost sure that a Grass newbie will first use the dbf

3 dbf-based examples are most common in Grass manuals (14 manuals,
postgres -10)

4 dbf is the only driver mentioned in "sqlnotes"

... yet the user who wants to start using dbf driver is not informed what
kind of data types are supported.

4 Shapefile, which uses dbf, is widely used for data exchange. In
particular
a Grass newbie who is migrating his data from other GIS is very likely to
use Shapefile. Thus the likelyhood of dbf-related problems and doubts
increases.

5 Could we assume that if somebody is using psql or other advanced database
then he automatically knows enough about it all so that he doesn't have
such
basic problems? If so, we could conclude that such a basic guiding is only
needed for dbmi amateurs (like me), who are using the default dbf driver.

I agree. Radim could you list the available types in the dbf driver,
or give me a pointer where I can find them, so that I can add the
list to the man page (and maybe even to the module itself) ?

Moritz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCv7BOrIrMbm76jD8RAtoCAJ9+6nKeVtwnnX7iYwVTPV50ZwmGMQCffPxi
wbL3MiN/ImfDGdOoKn4+EuA=
=GDtB
-----END PGP SIGNATURE-----

Moritz Lennert wrote:

I agree. Radim could you list the available types in the dbf driver,
or give me a pointer where I can find them, so that I can add the
list to the man page (and maybe even to the module itself) ?

The allowable column types are VARCHAR, INT, DOUBLE and DATE.

The clauses for parsing a CREATE TABLE statement are in
lib/db/sqlp/yac.y:

y_create:
    CREATE TABLE y_table '(' y_columndefs ')' { sqpCommand(SQLP_CREATE); }
  ;
  
y_columndefs:
    y_columndef
  | y_columndefs ',' y_columndef
  ;

y_columndef:
    NAME VARCHAR '(' INTNUM ')' { sqpColumnDef( $1, SQLP_VARCHAR, $4, 0 ); }
  | NAME INT { sqpColumnDef( $1, SQLP_INTEGER, 0, 0 ); }
  | NAME INTEGER { sqpColumnDef( $1, SQLP_INTEGER, 0, 0 ); }
  | NAME DOUBLE { sqpColumnDef( $1, SQLP_DOUBLE, 0, 0 ); }
  | NAME DOUBLE PRECISION { sqpColumnDef( $1, SQLP_DOUBLE, 0, 0 ); }
  | NAME DATE { sqpColumnDef( $1, SQLP_DATE, 0, 0 ); }
  ;

--
Glynn Clements <glynn@gclements.plus.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Glynn Clements wrote:

Moritz Lennert wrote:

I agree. Radim could you list the available types in the dbf driver,
or give me a pointer where I can find them, so that I can add the
list to the man page (and maybe even to the module itself) ?

The allowable column types are VARCHAR, INT, DOUBLE and DATE.

I suppose that these types exist in all backends, and so can be
considered as the minimum available ?

Moritz

The clauses for parsing a CREATE TABLE statement are in
lib/db/sqlp/yac.y:

y_create:
    CREATE TABLE y_table '(' y_columndefs ')' { sqpCommand(SQLP_CREATE); }
  ;
  
y_columndefs:
    y_columndef
  | y_columndefs ',' y_columndef
  ;

y_columndef:
    NAME VARCHAR '(' INTNUM ')' { sqpColumnDef( $1, SQLP_VARCHAR, $4, 0 ); }
  | NAME INT { sqpColumnDef( $1, SQLP_INTEGER, 0, 0 ); }
  | NAME INTEGER { sqpColumnDef( $1, SQLP_INTEGER, 0, 0 ); }
  | NAME DOUBLE { sqpColumnDef( $1, SQLP_DOUBLE, 0, 0 ); }
  | NAME DOUBLE PRECISION { sqpColumnDef( $1, SQLP_DOUBLE, 0, 0 ); }
  | NAME DATE { sqpColumnDef( $1, SQLP_DATE, 0, 0 ); }
  ;

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCwpq6rIrMbm76jD8RAs9/AJwLd68l5hX5sML1E2XDMupMdQxxRwCfedPn
9oS20q4OOcN/PRqSHh6BMTM=
=RM8z
-----END PGP SIGNATURE-----