Thread: TESTING the DATABASE

TESTING the DATABASE

From
Himmet Karaman
Date:
Hello to all,
Is there anyone who can explain me briefly, how can I test the database
that I created using PostgreSQL?
Thanks a lot for the time you spent ...

--

:::::::::::::::::::::::::::::::::::::::::::::::::
  Research Assistant
  Himmet KARAMAN
  Istanbul Technical University
  Geodesy and Photogrammetry Eng. Department
  34469 Maslak/ISTANBUL TURKEY
  Tel    : +90 (212) 285 67 83
  Fax    : +90 (212) 285 34 20
  Web    : http://atlas.cc.itu.edu.tr/~karamanhi
:::::::::::::::::::::::::::::::::::::::::::::::::




Re: TESTING the DATABASE

From
"Nigel J. Andrews"
Date:
On Thu, 15 May 2003, Himmet Karaman wrote:

> Hello to all,
> Is there anyone who can explain me briefly, how can I test the database
> that I created using PostgreSQL?
> Thanks a lot for the time you spent ...


Well, at a basic level...

$ psql mydbname
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

mydbname=> create table mytable ( a integer );
mydbname=> insert into mytable (a) values (1);
mydbname=> select * from mytable;
 a
---
 1
(1 row)

mydbname=>\q


The question is, what is it you want to test?


--
Nigel J. Andrews


Re: TESTING the DATABASE

From
Himmet Karaman
Date:
Hi,
I want to test all part of the database.
If the relations work, and all of the tables are ok, and can i make queries on my database...
i mean can my database do everything wright?
Is there any tool or command to test it?
Thanks again

Nigel J. Andrews wrote:
On Thu, 15 May 2003, Himmet Karaman wrote:
 
Hello to all,
Is there anyone who can explain me briefly, how can I test the database 
that I created using PostgreSQL?
Thanks a lot for the time you spent ...   

Well, at a basic level...

$ psql mydbname
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms      \h for help with SQL commands      \? for help on internal slash commands      \g or terminate with semicolon to execute query      \q to quit

mydbname=> create table mytable ( a integer );
mydbname=> insert into mytable (a) values (1);
mydbname=> select * from mytable;a
---1
(1 row)

mydbname=>\q


The question is, what is it you want to test?

 

-- 

::::::::::::::::::::::::::::::::::::::::::::::::: Research Assistant Himmet KARAMAN Istanbul Technical University Geodesy and Photogrammetry Eng. Department 34469 Maslak/ISTANBUL TURKEY Tel	: +90 (212) 285 67 83 Fax	: +90 (212) 285 34 20 Web	: http://atlas.cc.itu.edu.tr/~karamanhi 
:::::::::::::::::::::::::::::::::::::::::::::::::

Re: TESTING the DATABASE

From
"Shridhar Daithankar"
Date:
On 15 May 2003 at 10:27, Himmet Karaman wrote:

> I want to test all part of the database.
> If the relations work, and all of the tables are ok, and can i make queries on
> my database...
> i mean can my database do everything wright?
> Is there any tool or command to test it?

Compile from source and do a make check. That does this kind of regression
testing..Refer to build instructions in postgresql sources..

Bye
 Shridhar

--
Prejudice:    A vagrant opinion without visible means of support.        -- Ambrose
Bierce


Re: TESTING the DATABASE

From
"Nigel J. Andrews"
Date:

On Thu, 15 May 2003, Himmet Karaman wrote:

> Hi,
> I want to test all part of the database.
> If the relations work, and all of the tables are ok, and can i make
> queries on my database...
> i mean can my database do everything wright?
> Is there any tool or command to test it?
> Thanks again

Well that's the problem, only you can say what is right when testing your
database. You can easily write a script to construct a script which will issue
queries against all your tables individually , but then you're querying the
database in order to get that list of tables. With more effort you could write
a script to determine all the foriegn keys and construct many queries to
test the joining of tables based on this information, but again you'll be
querying the database in order to get that information in the first place.

In short, I don't believe there can be a tool that does what you want. If just
checking referential integrity and queriability (I don't think that is a word
btw) is what you want then it is possible to do it if you feel you can rely on
the system tables working as they should.

Having said that. Take a look in the source at src/test/regress/... as that
could provide you with a useful framework for you to incorporate the knowledge
of correctness that an automatic tool can not provide.


--
Nigel J. Andrews


>
> Nigel J. Andrews wrote:
>
> >On Thu, 15 May 2003, Himmet Karaman wrote:
> >
> >
> >
> >>Hello to all,
> >>Is there anyone who can explain me briefly, how can I test the database
> >>that I created using PostgreSQL?
> >>Thanks a lot for the time you spent ...
> >>
> >>
> >
> >
> >Well, at a basic level...
> >
> >$ psql mydbname
> >Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
> >
> >Type:  \copyright for distribution terms
> >       \h for help with SQL commands
> >       \? for help on internal slash commands
> >       \g or terminate with semicolon to execute query
> >       \q to quit
> >
> >mydbname=> create table mytable ( a integer );
> >mydbname=> insert into mytable (a) values (1);
> >mydbname=> select * from mytable;
> > a
> >---
> > 1
> >(1 row)
> >
> >mydbname=>\q
> >
> >
> >The question is, what is it you want to test?
> >
> >
> >
> >
>
>




Re: TESTING the DATABASE

From
"scott.marlowe"
Date:
If you want to test your own schema to make sure it works (i.e. foreign
key relations work right, etc...)  You'll have to write your own SQL to
prove it.

If you want to test your postgresql installation to make sure it's stable
and reliable under load, there are several different benchmarks out there
that can help.

pgbench comes with postgresql, and is in the $SRC/contrib/pgbench
directory.  Just cd there as root and do a 'make install' to install it,
then run it as a normal postgresql user to see it's options.

Look for the OSDB test suite on google, it's much larger and more
stressing on the system than pgbench tends to be, and is meant to be a
more well rounded benchmarking suite.

Finally, there's a nearly finished TPC-C style benchmark on sourceforge:

http://sourceforge.net/cvs/?group_id=52479

which was reported here on the list a few days ago.  No idea how close to
finished it is, but it's probably worth a look.

On Thu, 15 May 2003, Himmet Karaman wrote:

> Hi,
> I want to test all part of the database.
> If the relations work, and all of the tables are ok, and can i make
> queries on my database...
> i mean can my database do everything wright?
> Is there any tool or command to test it?
> Thanks again
>
> Nigel J. Andrews wrote:
>
> >On Thu, 15 May 2003, Himmet Karaman wrote:
> >
> >
> >
> >>Hello to all,
> >>Is there anyone who can explain me briefly, how can I test the database
> >>that I created using PostgreSQL?
> >>Thanks a lot for the time you spent ...
> >>
> >>
> >
> >
> >Well, at a basic level...
> >
> >$ psql mydbname
> >Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
> >
> >Type:  \copyright for distribution terms
> >       \h for help with SQL commands
> >       \? for help on internal slash commands
> >       \g or terminate with semicolon to execute query
> >       \q to quit
> >
> >mydbname=> create table mytable ( a integer );
> >mydbname=> insert into mytable (a) values (1);
> >mydbname=> select * from mytable;
> > a
> >---
> > 1
> >(1 row)
> >
> >mydbname=>\q
> >
> >
> >The question is, what is it you want to test?
> >
> >
> >
> >
>
>