[GRASSLIST:9377] Some question about db...

Hi guys...
I am moving the first step on db operation: following the info on this page,
http://grass.itc.it/grass61/manuals/html61_user/sql.html , I notice that the
command GROUP BY is not supported by DBF driver; I need to use DBMS to have
full support for SQL.
Running db.drivers I got only DBF and OGR as output... how can I enable DBMS ?

Thx
Luca

On czw, 2005-12-08 at 12:28 +0000, Luca Casagrande wrote:

Hi guys...
I am moving the first step on db operation: following the info on this page,
http://grass.itc.it/grass61/manuals/html61_user/sql.html , I notice that the
command GROUP BY is not supported by DBF driver; I need to use DBMS to have
full support for SQL.
Running db.drivers I got only DBF and OGR as output... how can I enable DBMS ?

I don't know if Grass packages provided by different distros and the
binaries at grass.itc.it are built with other DBMS support than for DBF
only.

In case you build from source, do ./configure --help first to read how
to enable different DBMS support. See the INSTALL file too. As to
postgres, from my experience once you have postgres devel packages in
your system Grass will automatically pick them and build with postgres
(at least this is the case for me in Mandriva 2005 and Ubuntu Hoary when
talking of Grass 6.1). If it doesn't, use different ./configure switches
to help it.

Recently there's been added support for sqlite in 6.1, which is not a
database server like posgres, much easier to use I think and quite
powefull, faster and more powerfull than DBF for sure. Might be an
interesting alternative to postgres, but I don't know how stable it is
now. Several days ago I experienced a complete system freeze using
v.out.ogr to export only 173863 lines with attributes stored in an
sqlite database in Grass. Maybe it is fixed now - Anybody knows? See
[GRASSLIST:9183] sqlite driver - remarks and questions, 22.11.2005.

Maciek

--------------------
Apteka internetowa Vena-Vita
http://vena-vita.pl/
Oferujemy leki, kosmetyki, materia³y medyczne.

Luca,

Please reply to all so your message is forwarded to grasslist to. There
are many Folks out there who might help you more. I might be wrong. You
have been warned ;).

On czw, 2005-12-08 at 16:42 +0000, Luca Casagrande wrote:

Alle 14:41, giovedì 08 dicembre 2005, hai scritto:

> On czw, 2005-12-08 at 12:28 +0000, Luca Casagrande wrote:
> > Hi guys...
> > I am moving the first step on db operation: following the info on this
> > page, http://grass.itc.it/grass61/manuals/html61_user/sql.html , I notice
> > that the command GROUP BY is not supported by DBF driver; I need to use
> > DBMS to have full support for SQL.
> > Running db.drivers I got only DBF and OGR as output... how can I enable
> > DBMS ?
>
> I don't know if Grass packages provided by different distros and the
> binaries at grass.itc.it are built with other DBMS support than for DBF
> only.
>
> In case you build from source, do ./configure --help first to read how
> to enable different DBMS support. See the INSTALL file too. As to
> postgres, from my experience once you have postgres devel packages in
> your system Grass will automatically pick them and build with postgres
> (at least this is the case for me in Mandriva 2005 and Ubuntu Hoary when
> talking of Grass 6.1). If it doesn't, use different ./configure switches
> to help it.
>
> Recently there's been added support for sqlite in 6.1, which is not a
> database server like posgres, much easier to use I think and quite
> powefull, faster and more powerfull than DBF for sure. Might be an
> interesting alternative to postgres, but I don't know how stable it is
> now. Several days ago I experienced a complete system freeze using
> v.out.ogr to export only 173863 lines with attributes stored in an
> sqlite database in Grass. Maybe it is fixed now - Anybody knows? See
> [GRASSLIST:9183] sqlite driver - remarks and questions, 22.11.2005.
>
> Maciek

Thx for your answer!

Let me know if i am right: i got an shp file with its dbf table; when I import
in grass the vector layer is beeing connected by a standard dbf driver to the
table,

Yes, by default dbf is used. When you v.in.ogr a shapefile, the
shapefile's dbf is imported into a Grass' dbf file, which is stored in
your mapset's dbf directory.

but i can change that connection to use any one, for example sqlite
(so i can use extra command that aren't in DBF).

AFAIK: first you set a connection to a desired database using an
appropriate driver. See db.connect. Each next created/imported vector
file will store attributes using this settings.

Right?

P.S.
Still i haven't found the way to add DBMS in ./configure :frowning:

Heres's what I meant (examples only, inspect the whole ./configure
--help output for all possible options):

maciek@sorbus:~/src/straight/grass6$ ./configure --help | grep postgres
  --with-postgres support PostgreSQL functionality (default: yes)
  --with-postgres-includes=DIRS
  --with-postgres-libs=DIRS

maciek@sorbus:~/src/straight/grass6$ ./configure --help | grep sqlite
  --with-sqlite support SQLite functionality (default: no)
  --with-sqlite-includes=DIRS
  --with-sqlite-libs=DIRS SQLite library files are in DIRS

Of course after you configure your Grass source code for DBMs support,
you have to build and install it (uninstall the previous Grass vecrsion
first). See INSTALL file.

Like I said before, I don't know if any precompiled Grass packages
provide more than DBF. I can't say, I always install Grass from source.
Anybody knows?

Maciek

--------------------
Apteka internetowa Vena-Vita
http://vena-vita.pl/
Oferujemy leki, kosmetyki, materia?y medyczne.