[GENERAL] Sample database with difficult SQL questions

2013-06-08 Thread Alexander Gataric
I need a sample database and hard practice SQL questions (multiple joins, 
window functions, subqueries, CTEs) to write ad hoc queries or perform database 
tasks. Any suggestions are welcome. Thanks in advance.

Sent from my smartphone

- Reply message -
From: g.si...@utwente.nl
To: 
Subject: [GENERAL] Postgres 8.4 stopped working---Please urgent help needed
Date: Sat, Jun 8, 2013 5:04 pm
Hi All,





I have a problem with PostgreSQL 8.4. It was working perfectly fine but after 
the restart (within a couple of minutes)  of my system whenever I login to 
PostgreSQL 8.4 (localhost:5432)
it gives error as under:



Server doesn't listen

The server doesn't accept connections: the connection library reports

could not connect to server: Connection refused (0x274D/10061) Is the 
server running on host "localhost" (::1) and accepting TCP/IP connections on 
port 5432? could not connect
to server: Connection refused (0x274D/10061) Is the server running on host 
"localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

If you encounter this message, please check if the server you're trying to 
contact is actually running PostgreSQL on the given port. Test if you have 
network connectivity from
your client to the server host using ping or equivalent tools. Is your network 
/ VPN / SSH tunnel / firewall configured correctly?

For security reasons, PostgreSQL does not listen on all available IP addresses 
on the server machine initially. In order to access the server over the 
network, you need to enable
listening on the address first.

For PostgreSQL servers starting with version 8.0, this is controlled using the 
"listen_addresses" parameter in the postgresql.conf file. Here, you can enter a 
list of IP addresses
the server should listen on, or simply use '*' to listen on all available IP 
addresses. For earlier servers (Version 7.3 or 7.4), you'll need to set the 
"tcpip_socket" parameter to 'true'.

You can use the postgresql.conf editor that is built into pgAdmin III to edit 
the postgresql.conf configuration file. After changing this file, you need to 
restart the server
process to make the setting effective.

If you double-checked your configuration but still get this error message, it's 
still unlikely that you encounter a fatal PostgreSQL misbehaviour. You probably 
have some low
level network connectivity problems (e.g. firewall configuration). Please check 
this thoroughly before reporting a bug to the PostgreSQL community.





I checked the pg_log file and it shows following:

2013-06-08 20:16:58 CESTLOG:  database system was shut down at 2013-06-08 
20:10:02 CEST

2013-06-08 20:16:58 CESTFATAL:  the database system is starting up

2013-06-08 20:16:58 CESTLOG:  database system is ready to accept connections

2013-06-08 20:16:58 CESTLOG:  autovacuum launcher started



I am unable to make out what is going wrong. Then I try to restart the Postgres 
service but it does not get started and gives error continuously. The error is:

Windows could not start the PostgreSQL Server 8.4 service on Local Computer.

Error 1053: The service did not respond to the start or control request in a 
timely fashion.





Please I need urgent help pleaseā€¦



Thanks and Regards

Gaurav

[GENERAL] Re: [GENERAL] Cast double precision to integer & check for overflow

2013-01-26 Thread Alexander Gataric
Just cast to integer. Decimal portion will be lost.

Sent from my smartphone

- Reply message -
From: "Ian Pilcher" 
To: 
Subject: [GENERAL] Cast double precision to integer & check for overflow
Date: Sat, Jan 26, 2013 3:13 pm


I need to cast a double precision into an integer, and I want to check
that the value will actually fit (modulo rounding).

Coming from a C/Java background, this seems like something that should
be utterly trivial.  In my searching, however, I can't seem to find any
SQL equivalent of INT_MAX, Integer.MAX_VALUE, etc.

Do I have to hard-code this value?

Thanks!

(And yes, I do feel stupid having to ask this question here.)

-- 

Ian Pilcher arequip...@gmail.com
Sometimes there's nothing left to do but crash and burn...or die trying.




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


[GENERAL] Custom JDBC wrapper for DB2 Fed Server

2013-01-09 Thread Alexander Gataric
I was wondering if there is a Postgres JDBC Type 4 wrapper for DB2 Federated
Server. The default wrapper from IBM has a number of issues with Postgres
which a better wrapper could solve. I will attempt to modify the IBM wrapper
if I can get my hands on the source code.



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


[GENERAL] Boolean type storage format

2012-10-31 Thread Alexander Gataric
What is the data physically stored as for boolean type? I know that it is one 
byte but is it char, int, or something else?

Sent from my smartphone



[GENERAL] Re: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server

2012-10-14 Thread Alexander Gataric
The IBM people aren't being helpful so I thought I'd ask here.

Sent from my smartphone

- Reply message -
From: "John R Pierce" 
To: 
Subject: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server
Date: Sun, Oct 14, 2012 8:05 pm


On 10/14/12 5:52 PM, Alexander Gataric wrote:
>
> I'm on a project which requires adding PostgreSQL tables to DB2 > Federated 
> Server. I'm getting an error with PostgreSQL data types > boolean, text, 
> bytea, and XML. I believe this can be solved with the > CREATE TYPE MAPPING 
> in Fed Server. Does anyone know which values to > use? I'm not that familiar 
> with Fed Server.
>
> Also, the Postgres data is being extracted and inserted from the same > table 
> using Optim Archive. Does this pose an additional challenge with > setting up 
> the mapping?
>

I suggest you talk to your IBM support contacts for these issues, they really 
have little to do with Postgres and are completely beyond postgres' control.



-- 
john r pierceN 37, W 122
santa cruz ca mid-left coast



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


[GENERAL] Mapping PostgreSQL data types to DB2 Federated Server

2012-10-14 Thread Alexander Gataric
Hello,

I'm on a project which requires adding PostgreSQL tables to DB2 Federated
Server. I'm getting an error with PostgreSQL data types boolean, text,
bytea, and XML. I believe this can be solved with the CREATE TYPE MAPPING in
Fed Server. Does anyone know which values to use? I'm not that familiar with
Fed Server.

Also, the Postgres data is being extracted and inserted from the same table
using Optim Archive. Does this pose an additional challenge with setting up
the mapping?

Thank you in advance

Alex

 



[GENERAL] Best free tool for relationship extraction

2012-09-13 Thread Alexander Gataric
I need to determine relationships between several tables. Is there a free tool 
to extract these from catalog tables? Is there an SQL that also does this?

Thanks
Alex

Sent from my smartphone



[GENERAL] Character validation with DB2 Fed Server and Optim

2012-08-03 Thread Alexander Gataric
I'm going to be accessing a Postgres database through DB2 Federated Server
and extracting/inserting with IBM Optim. I want to verify that Optim and DB2
are not corrupting text characters. This SQL should generate a sample set of
characters: 

Select genseries, chr( genseries) from generate_series(1,2000) as genseries

After extracting with Optim and inserting into a new table, I can write a
simple query to compare the tables for differences. The Postgres database is
using UTF8 encoding. I'm not sure if the chr function is the best way to
generate a sample set of characters and I'm not if this is the correct
range.

I would appreciate any feedback on this approach and welcome suggestions on
another approach.

Thanks
Alex


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