Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Mon, Jan 23, 2012 at 02:20:31PM +0100, Stephan Bergmann wrote:
On 01/23/2012 01:45 PM, Lionel Elie Mamane wrote:

Users loose the feature to use a newer PostgreSQL-SDBC with an
older LibreOffice. But Fridrich and you agree it fixes all our
issues, so OK, I consent to it. I'm happy to let you and/or
Fridrich do the change.

Doing it.  Lionel, do you have a recipe for database-dummies how to
actually test the postgresql-sdbc functionality?

To really test it, you need a PostgreSQL server. However, you can do a
very limited, but still meaningful, test without it:

 - Menu: File / New / Database

 - Connect to an existing database: PostgreSQL

 - Next

 - Datasource URL: host=localhost

 - Next

 - User name: blank

 - Test connection -> the error message should be along the lines of:

   Couldn't establish database connection to 'sdbc:postgresql:host=localhost'
   could not connect to server: Connection refused
   is the server running on host "localhost" (::1) and accepting
   TCP/IP connections on port 5432?
   could not connect to server: Connection refused
   is the server running on host "localhost" (127.0.0.1) and accepting
   TCP/IP connections on port 5432?

   If you get any other error message (such as "no driver registered
   for URL"), then there is something wrong with PostgreSQL-SDBC or
   LibreOffice more generally. I you get the error message only with
   127.0.0.1 and not with ::1, that's fine and not a problem.

 - OK to click error message away

 - next

 - no, do not register the database

 - uncheck "open the database for editing"

 - finish

 - choose a filename to save file to

 - save

 - close libreoffice

 - open libreoffice again, open file you just created

 - in the left part of the main screen, click "tables"

   You should get the same error message as above with "test
   connection". If not, it is a problem.



As to installing a PostgreSQL server, rather easy on Debian GNU/Linux
and probably most other distros. Make sure you get version 8.4 or
later.

aptitude install postgresql
sudo -u postgres createdb -O $USER name_you_choose "$USER's test DB"
psql --db name_you_choose
CREATE TABLE "names" ( num serial, name varchar(30) NOT NULL, PRIMARY KEY (num) );
# It says:
# NOTICE:  CREATE TABLE will create implicit sequence "names_num_seq" for serial column "names.num"
# NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "names_pkey" for table "names"
# CREATE TABLE
INSERT INTO "names" (name) VALUES ('Alice'), ('Bob'), ('Eve'), ('Mallory');
INSERT INTO "names" (num, name) VALUES (0, 'Nominem incognitum');
\q
#back to the shell

Now, do as above in LibreOffice, except put:

Datasource URL: host=localhost dbname=name_you_choose
User name: Your UNIX username
Do *not* check "needs password".

You'll see in tables the "names" table. You can double-click on it and
modify data, insert new data, delete row, etc.

-- 
Lionel

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.