[GENERAL] changing from postgreSQL 8.3 to 9.0

2011-09-26 Thread Malm Paul
Hi,
I have a database created on ver 8.3 an have restored the database in a new 
database in PostgreSQL 9.0.
In the database i'm using a column storing "bytea".

When trying to read the database with my java application, I have problems 
reading from the bytea-stream.
Integers read is not correct. I can see that there is something new in ver 9.0: 
LC_COLLATE. Has that someting to do with my problem reading from "bytea".
If so, what is the easiest way to get around this problem, when importing the 
database that is created in PostgreSQL 8.3?

Kind regards,
Paul



[GENERAL] Setting up tablepace

2011-06-15 Thread Malm Paul
Hi all,
I have a problem with setting up tablespace on a ramdisk.
the ramdisk shall be used temporary for storing unprotected map data, that is 
normaly protected.

I'm working in Linux.
I have an ordirnary Linux user called normaluser, a user called chartuser (the 
ramdisk owner, the password is not known to the normal users), and a ordinary 
postgres user.

Chartuser and root are the only ones that has access to the ramdisk.

I have succeeded to store (as normaluser) the unprotected map files on the 
ramdisk, only accessable for chartuser.

I would now like to import the map files to a GIS db that has the tabespace on 
the ramdisk. But I'm not able to create the tablespace on the ramdisk.
Trying logged in as chartuser to run: psql -c "CREATE TABLESPACE ramspc 
LOCATION '/tmp/ramdisk0/tblspace'"
 "could not set permission on directory "/tmp/ramdisk0/tblspace": premission 
denied"...

Any ideas, anyone?
Thanks,
Paul


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] new databases using a template.

2011-02-28 Thread Malm Paul
Hi,
I'm trying to create a new database by using a template database. But it is not 
possible. The error code is that some one is using the template, but no one is 
using it.
I'm using PgAdmin III ver 1.1.0. Has some one seen something like this?
/Paul



From: pgsql-general-ow...@postgresql.org 
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rob Richardson
Sent: den 28 februari 2011 16:19
To: pgsql-general@postgresql.org
Cc: Tim Kelly
Subject: Re: [GENERAL] Thoroughly confused about time zones

I think maybe I'm making things much more difficult than they need to be.  I 
tried this:

select cast (extract(epoch from ('2010-3-14 12:00'::timestamp - '2010-3-13 
12:00'::timestamp)) as integer) / 60 / 60

and got 24.  The difference between timestamps without time zones is 24 hours, 
even though the interval spanned a time change.

But when I tried this:

select cast (extract(epoch from ('2010-3-14 12:00'::timestamptz - '2010-3-13 
12:00'::timestamptz)) as integer) / 60 / 60

I got 23, showing that even if I did not specify what time zone I'm talking 
about, I got the correct answer.


RobR


[GENERAL] restore a server backup

2011-02-28 Thread Malm Paul
Hi, I've used PgAdmin III to store a server backup. But I'm not able to restore 
it.

Please, could any one tell me how to do it? Im using version 1.10
/Paul


[GENERAL] postgreSQL-devel 8.3.8

2010-11-15 Thread Malm Paul
Hi,
I need to download postgreSQL develope package for ver. 8.3.8, but I can not 
find the ...i386.rpm anywhere.

Please, could someone guide me to the right place?
Kind regards,
Paul

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] uppdate from postgersql 8.3.7 to 8.4.4

2010-05-25 Thread Malm Paul
Hi,
I'm trying to update postgresql ver 8.7.3 to 8.4.4
At the end of the installation when trying to styart the database server I 
get the following error meassage: "Problem running post-install step. 
Installation may not complete correctly. Failed to start the database server"

And when I try to start the server manually I get the following console print 
out:
Start DoCmd(net postgresql-8.4)...
System error 1069 has occured.
The service did not start due to a logon failure.
Failed to start the database server.


I've checked the 8.4\Data folder and it is empty.

Is ther anyone who has a solution for this?

Kind regards,
Paul



Re: [GENERAL] metadata on a table

2010-05-19 Thread Malm Paul
Ahhh.

boolean isAutoIncerment = rsMetaData.isAutoIncrement(1);

if int4 and autoIncremented = serial

Sorry!!


From: pgsql-general-ow...@postgresql.org 
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Malm Paul
Sent: den 19 maj 2010 08:44
To: pgsql-general@postgresql.org
Subject: [GENERAL] metadata on a table

Hi,
I'm trying to read the metadata from table to create the same sort of table in 
another database, using java.

This is how I do it today

quwstion = "SELECT  * FROM table"
stmnt = dbConnection.prepareStatement(question);

rs = stmnt.executeQuery();

ResultSetMetaData rsMetaData = rs.getMetaData();
int numberOfColumns = rsMetaData.getColumnCount();
System.out.println("resultSet MetaData column Count=" + numberOfColumns);
int precision = rsMetaData.getPrecision(1);
String columnTypeName = rsMetaData.getColumnTypeName(1);
String name = rsMetaData.getColumnName(1);
String classname = rsMetaData.getColumnClassName(1);

The first object is the primary key with the name "fid",
columnTypeName = int4

I can see in the original table that fid has the type serial, which is an int4 
(pgAdmin).
But when I create the table in the other database I would like to create it as 
serial not just int4, how can I know that it is a serial?

Kind regards,
Paul


[GENERAL] metadata on a table

2010-05-18 Thread Malm Paul
Hi,
I'm trying to read the metadata from table to create the same sort of table in 
another database, using java.

This is how I do it today

quwstion = "SELECT  * FROM table"
stmnt = dbConnection.prepareStatement(question);

rs = stmnt.executeQuery();

ResultSetMetaData rsMetaData = rs.getMetaData();
int numberOfColumns = rsMetaData.getColumnCount();
System.out.println("resultSet MetaData column Count=" + numberOfColumns);
int precision = rsMetaData.getPrecision(1);
String columnTypeName = rsMetaData.getColumnTypeName(1);
String name = rsMetaData.getColumnName(1);
String classname = rsMetaData.getColumnClassName(1);

The first object is the primary key with the name "fid",
columnTypeName = int4

I can see in the original table that fid has the type serial, which is an int4 
(pgAdmin).
But when I create the table in the other database I would like to create it as 
serial not just int4, how can I know that it is a serial?

Kind regards,
Paul


Re: [GENERAL] creating a table based on a table in stored in another database

2010-05-18 Thread Malm Paul
 I can add that I would like to do this in my java application.
E.i. just create an empty table in database1 which has the same column names 
and types as a table stored in database2.

I tried this for a start:
stmnt = dbConnection.prepareStatement("select dblink_connect('myconn', 
'dbname=gemaps')");
resultset = stmnt.executeQuery();

but got ERROR: function dblink_connect(unknown, unknown) does not exist

/P
-Original Message-
From: pgsql-general-ow...@postgresql.org 
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of A. Kretschmer
Sent: den 18 maj 2010 10:16
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] creating a table based on a table in stored in another 
database

In response to Malm Paul :
>  Hi list,
> in a database I have different kind of tables. I would like to take the meta 
> data from one of those tables and create the same type of table (but empty) 
> in another database.
> Can anyone, please, tell me how to do this?

Create a schema-only dump and restore it into the other database.


Regards, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make 
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] creating a table based on a table in stored in another database

2010-05-18 Thread Malm Paul
 Hi list,
in a database I have different kind of tables. I would like to take the meta 
data from one of those tables and create the same type of table (but empty) in 
another database.
Can anyone, please, tell me how to do this?

Kind regards,
Paul


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] import warnings ?

2009-12-21 Thread Malm Paul
Hi list,
I'm using FWTOOLS ogr2gr to import a s57 chart. Im getting a warning when I'm 
importing in Linux but not in Windows XP, see below.
Could anyone tell me why and what the difference is in the result (I can't see 
it because the lnam_refs is empty), will I miss anything? 

ogr2ogr -f "PostgreSQL" PG:"host=localhost dbname=US3MI01M user=ddd 
password=pwd" ./US3MI01M/US3MI01M.000 -lco OVERWRITE=yes -nln depare DEPARE 
-t_srs "EPSG:4326"

Warning 6: Can't create field lnam_refs with type StringList on PostgreSQL 
layers.  Creating as VARCHAR.
-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] dumping parts of a database

2009-11-16 Thread Malm Paul
Hi List,
I have a database with two tables header and idata, they are connected with an 
conn_ID.
I would like to dump header and the connected idata tables with a certain 
conn_ID. This I would like to import to the same type of database on another 
PostgreSQL server.

I would be gratefull if someone could tell me how I dump those tables and how 
do I import them in another database?

Kind regards,
Paul


[GENERAL] Newbee to databases (ODBC)

2008-01-21 Thread Malm Paul
Hi all,
I'm sorry to bother you with this question, I know it is a C++ ODBC
question. But I'm a bit desperate.
Perhaps I'll be lucky.

I have a table with 2 columns no_char and blobdata were no_char is
number of characters in blobdata. I would like to handle each row from
the result set.


I have got this far:

//Setup selectstatement
strcpy((char*) SQLStmt, "Select no_char, blobdata from tab1");

//Execute the statement
rc = SQLExecDirect(dbConnection.StmtHandle, SQLStmt, SQL_NTS);

//Define what to read out from the selection set
rc =SQLBindCol(StmtHandle, 1 SQL_C_LONG, (SQLPOINTER) &no, sizeOf(no),
NULL); 
rc =SQLBindCol(StmtHandle, 2 SQL_C_BINARY, (SQLPOINTER) blob, no, NULL);

// get the values
while(SQLFetch(StmtHandle) != SQL_NO_DATA) 
{
...
...
}

But this will not work since I'm using "no" in the second statement to
define the blob size, and no is not set yet.
I could solve it by using 2 different select statemen (once for the size
and one for the blob) but that seems to be a bad solution. 

Sorry again!
/Paul