[SQL] hi i need to connect database from my system to another system

2006-07-03 Thread Penchalaiah P.








Hi good afternoon to every one..

 

I am using postgresql database server… in my system..
if I want to connect to this database server from other system..Or how can I use
this database server  in other machine ..

How can I do this..if any one have idea about this please
give me brief description

 

Thanks  &  Regards

Penchal reddy | Software Engineer
  

Infinite Computer Solutions | Exciting Times…Infinite Possibilities... 

SEI-CMMI level 5 | ISO 9001:2000

IT SERVICES |
BPO  


Telecom | Finance
| Healthcare | Manufacturing
| Energy & Utilities | Retail
& Distribution | Government   


Tel +91-80-5193-(Ext:503)| Fax  +91-80-51930009 | Cell No  +91-9980012376|www.infics.com  

Information transmitted by this e-mail is
proprietary to Infinite Computer Solutions and/ or its Customers and is
intended for use only by the individual or entity to which it is addressed, and
may contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you are not the intended recipient or it
appears that this mail has been forwarded to you without proper authority, you
are notified that any use or dissemination of this information in any manner is
strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this mail from your records.

 







Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and / or its Customers and is intended for use only by the individual or the entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this email from your records.


Re: [SQL] graph plottin engines compatible with postgres

2006-07-03 Thread Patrick Jacquot

Parang Saraf wrote:


hey,

I wanted to know about graph plotting engine that is compatible with 
postgres 8.1.4. I am performing some queries like :
Comparing the speed of three runners namely A, B and C versus time. I 
want to publish the result in a graphical manner on the net instead of 
just providing the data.


So, if you could provide me with some information on how i can do it 
then that would be great.


thanks and regards
parang saraf
[EMAIL PROTECTED] 


I use gnuplot to do that kind of stuff since 1997.
Example for two curves on the same graph :

LANG=fr
LINGUAS=fr
psql editor < plotdata
select distinct d, totblo, utiblo from area where tp='$1' and area = 
'EDDON01'  and d > 'today'::date-365 order by d;

\o
\q
finpsql
gnuplot 

Re: [SQL] hi i need to connect database from my system to another system

2006-07-03 Thread Richard Broersma Jr

> I am using postgresql database server... in my system.. if I want to
> connect to this database server from other system..Or how can I use this
> database server  in other machine ..
> 
> How can I do this..if any one have idea about this please give me brief
> description

You need to start the postgresql server with the "-i" option to allow TCP/IP 
connections.  Then
you need to configure your pg_hba.conf file to set the permissions about which 
users can connect
to which databases.

Notice the pg_ctl section for starting postgresql.
http://www.postgresql.org/docs/8.1/interactive/app-pg-ctl.html

Notice the -o "options" section that can be set. (in this case you want -i)
http://www.postgresql.org/docs/8.1/interactive/app-postmaster.html

Finally notice, the section on the pg_hba.conf file.
http://www.postgresql.org/docs/8.1/interactive/client-authentication.html#AUTH-PG-HBA-CONF

Also, secure shell also works well when connecting from another system.

Regards,

Richard Broersma Jr.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: Fwd: [SQL] Start up question about triggers

2006-07-03 Thread Forums @ Existanze
Hello again,

I did some research on your suggestions with Slony-I and logshipping, one
major drawback we just realized is that the server where postgres will sit
on runs Windows XP. Our client has this techie that only knows how to manage
a windows box, and he runs some other services that we cannot port to linux.
Is there anything similar to slony-I that we could run on windows? 

On the install notes of Slony 1.1.5 we didn't find any information about
compiling and running Slony-I on windows and we know that it will be
available in version 1.2 

Best Regards,
Fotis


> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Joe
> Sent: 27 June 2006 15:15
> To: Andrew Sullivan
> Cc: pgsql-sql@postgresql.org
> Subject: Re: Fwd: [SQL] Start up question about triggers
> 
> Andrew Sullivan wrote:
> > On Tue, Jun 27, 2006 at 11:16:17AM +0300, Forums @ Existanze wrote:
> >> I looked into slony, I have a question though, how would I 
> go about 
> >> controlling slony via a jdbc driver? See this whole problem has 
> >> arisen because for some reason my client wants to keep to separate 
> >> databases in two separate locations with the same data. So 
> he would 
> >> call this partiall backup function via a GUI client we 
> provide, and 
> >> with this information he would go to the same GUI client in this 
> >> other location and import this partiall backup.
> > 
> > It is totally normal to want to keep two databases in two locations:
> > that's a matter of safety.  Slony does it automatically, as long as 
> > the daemon is running.  No need to control it.
> 
> But with file-based log shipping (see
> http://linuxfinances.info/info/logshipping.html) one could 
> write a Java app to control when the updates are applied.
> 
> Joe
> 
> ---(end of 
> broadcast)---
> TIP 1: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to [EMAIL PROTECTED] 
> so that your
>message can get through to the mailing list cleanly
> 


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [SQL] hi i need to connect database from my system to another system

2006-07-03 Thread Richard Broersma Jr
> If u don't mind can u please tell me clearly.. where I have start -I or
> how to start postgresql with -I

> > I am using postgresql database server... in my system.. if I want to
> > connect to this database server from other system..Or how can I use
> this
> > database server  in other machine ..
> >
> > How can I do this..if any one have idea about this please give me
> brief
> > description
> 
> You need to start the postgresql server with the "-i" option to allow
> TCP/IP connections.  Then
> you need to configure your pg_hba.conf file to set the permissions about
> which users can connect
> to which databases.
> 
> Notice the pg_ctl section for starting postgresql.
> http://www.postgresql.org/docs/8.1/interactive/app-pg-ctl.html
> 
> Notice the -o "options" section that can be set. (in this case you want
> -i)
> http://www.postgresql.org/docs/8.1/interactive/app-postmaster.html
> 
> Finally notice, the section on the pg_hba.conf file.
> http://www.postgresql.org/docs/8.1/interactive/client-authentication.htm
> l#AUTH-PG-HBA-CONF
> 
> Also, secure shell also works well when connecting from another system.

Don't forget to include the pgsql-sql list in your reply's. :-)  The 
individuals on this list have
varying degree of experience and knowledge of postgresql.  So if you only 
respond to me, you would
be limiting yourself to my meager experience and knowledge. ;-)

To start off with, it would be helpful to know which OS version of PostgreSQL 
you are using.  The
windows versions is pre-configured to start with the "-i" option for allowing 
TCP/IP connections.

Secondly,  how are you trying to connect to your postgresql server from another 
system?  What
error messages are you getting.

Regards,

Richard Broersma Jr.



---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] hi i need to connect database from my system to another

2006-07-03 Thread Penchalaiah P.

Hi

I am using windows xp operating system...
I want to know how to connect remote postgresql from my system.. I need
brief description from beginning..
Now I am using pg_HBF conf file to connect remote postgresql in that I
am giving host name , ip-address,mask and trust... but it is showing
error like

Could not connect to server: connection refused(0x274d\10061)
Is the server running on host 127.0.0.1 and accepting TCP\IP connection
on port 5432 ?


Regards
penchal

-Original Message-
From: Richard Broersma Jr [mailto:[EMAIL PROTECTED]
Sent: Monday, July 03, 2006 5:57 PM
To: Penchalaiah P.
Cc: General Postgresql List
Subject: RE: [SQL] hi i need to connect database from my system to
another system

> If u don't mind can u please tell me clearly.. where I have start -I
or
> how to start postgresql with -I

> > I am using postgresql database server... in my system.. if I want to
> > connect to this database server from other system..Or how can I use
> this
> > database server  in other machine ..
> >
> > How can I do this..if any one have idea about this please give me
> brief
> > description
>
> You need to start the postgresql server with the "-i" option to allow
> TCP/IP connections.  Then
> you need to configure your pg_hba.conf file to set the permissions
about
> which users can connect
> to which databases.
>
> Notice the pg_ctl section for starting postgresql.
> http://www.postgresql.org/docs/8.1/interactive/app-pg-ctl.html
>
> Notice the -o "options" section that can be set. (in this case you
want
> -i)
> http://www.postgresql.org/docs/8.1/interactive/app-postmaster.html
>
> Finally notice, the section on the pg_hba.conf file.
>
http://www.postgresql.org/docs/8.1/interactive/client-authentication.htm
> l#AUTH-PG-HBA-CONF
>
> Also, secure shell also works well when connecting from another
system.

Don't forget to include the pgsql-sql list in your reply's. :-)  The
individuals on this list have
varying degree of experience and knowledge of postgresql.  So if you
only respond to me, you would
be limiting yourself to my meager experience and knowledge. ;-)

To start off with, it would be helpful to know which OS version of
PostgreSQL you are using.  The
windows versions is pre-configured to start with the "-i" option for
allowing TCP/IP connections.

Secondly,  how are you trying to connect to your postgresql server from
another system?  What
error messages are you getting.

Regards,

Richard Broersma Jr.



Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [SQL] hi i need to connect database from my system to another

2006-07-03 Thread Richard Broersma Jr
> I am using windows xp operating system...
> I want to know how to connect remote postgresql from my system.. I need
> brief description from beginning..
> Now I am using pg_HBF conf file to connect remote postgresql in that I
> am giving host name , ip-address,mask and trust... but it is showing
> error like
> 
> Could not connect to server: connection refused(0x274d\10061)
> Is the server running on host 127.0.0.1 and accepting TCP\IP connection
> on port 5432 ?

Actually,  your PostgreSQL server is running on the IP address that is assigned 
to that computer.

The 127.0.0.1 in the pg_hba.conf file is the initial accepted client IP address 
that your
postgresql server will accepted connections from.  127.0.0.1 is basically means 
localhost.  So,
your pg_hba.conf file is initial configured to only allow client connections 
from itself.

So in this case, if you want to connect from an IP address from a different 
computer, you will
need to specify that ip address in your pg_hba.conf file as well as the 
permissions.

But just to get started, you could try editing a line in your pg_hba.conf to 
this:

#hostall all 127.0.0.1/32md5
 
hostall all/24 trust
hostall all 127.0.0.1/32trust

To understand all of this, you will need to read the introduction in your 
pg_hba.conf file. Also,
keep in mind that the above change is basically an "open door" to everything in 
your DB server. 
So after you've had a change to get familiar with everything, you will want to 
tighten up on
how,what, and how access is granted to you system.

"Last but not least", you will need to restart your postgresql service so these 
changes will take
effect.

This should get you connected.

Regards,

Richard Broersma Jr.


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[SQL] Local variable and column name conflict

2006-07-03 Thread Daniel Caune
Hi,

Is there a way to specify a local variable/parameter within a query
where a column has the same name than the local variable/parameter?

Example:

CREATE OR REPLACE FUNCTION foo(i IN int)
  RETURNS void
AS $$
BEGIN
  UPDATE bar
SET i = i; // column i = parameter i
END;
$$ LANGUAGE PLPGSQL;

For instance, Ingres suggests prefixing local variable/parameter with
":" in the query:

  UPDATE bar
SET i = :i;

I can continue using the de facto Oracle's naming convention
(P_parameter and V_local_variable) anyway.  That's not a big deal.

Regards,

--
Daniel CAUNE
Ubisoft Online Technology
(514) 490 2040 ext. 3613

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] Local variable and column name conflict

2006-07-03 Thread Tom Lane
"Daniel Caune" <[EMAIL PROTECTED]> writes:
> CREATE OR REPLACE FUNCTION foo(i IN int)
>   RETURNS void
> AS $$
> BEGIN
>   UPDATE bar
> SET i = i; // column i = parameter i
> END;
> $$ LANGUAGE PLPGSQL;

In SELECTs you can qualify the column, ie, bar.i vs i.  That doesn't
work for an UPDATE target, though, so probably the best answer is
"don't do that".  I think it's entirely too error-prone anyway ...

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [SQL] join two tables with sharing some columns between two

2006-07-03 Thread Thomas Beutin
Hi,

filippo wrote:
> I have two tables like these: (this is an example, the actual tables
> have diffferent fields and meanings)
> 
> TABLE1
> id
> person_name
> date_arrival
> date_departure
> 
> TABLE2
> id
> car_description
> date_arrival
> date_departure
> 
> I'd like to make a query to have such resulting table
> 
> RESULTING_TABLE
> id
> person_name
> car_description
> date_arrival
> date_departure
> 
> the id is the primary key for the three tables and it's unique for the
> three (id in table1 cannot be in table2, I use the same counter to
> generate the id for table1 and table2).

SELECT
 id, person_name, NULL AS car_description, date_arrival, date_departure
 FROM TABLE1
UNION
SELECT
 id, NULL AS person_name, car_description, date_arrival, date_departure
 FROM TABLE2
ORDER BY 


But be careful, w/o constraints there's no guarantee that the id's are
really unique on both tables!

HTH,
-tb

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [SQL] unique values of profile in the whole system

2006-07-03 Thread Bruno Wolff III
On Wed, Jun 28, 2006 at 08:56:31 -0700,
  [EMAIL PROTECTED] wrote:
> * tbl_data_type : contains the data type of the profile, their id
>   and their names. E.g.: id=1, data type name="last name"; id=2,
>   data type name="address", and so on
> * tbl_data : the data of all the profiles of the system; it has
>   three columns: the id of the profile the data belongs to (linked
>   to the tbl_user), the data type id (linked to tbl_data_type) and
>   the value of the data. E.g.: profile=1, data_type_1=1,
>   value="Smith", and so on
> Suppose we have a data type named "unique_id", which value should be
> stored in tbl_data. The value must be unique in the whole system, so
> the
> profiles store only one "unique_id", and I have to able to identify a
> profile by this value(that's why must be unique!).
> Generating such a unique id it's not a problem, using e.g. a sequence.
> The problem is the user can change this value accessing to the proper
> stored procedure, and the system should check that the value chosen do
> not violate the requirement of uniqueness.
> 
> I have only two solutions, I'd be glad to hear from you if they are
> correct, or if you have already encountered similar problems and you
> can
> point me to some useful document.

You could add a flag to tbl_data that indicates whether or not the data should
be unique. Then you can create a partial index where this flag is true
over the combination of type id and value.
For referential integrity of the flag, you can add the same flag to the
tbl_data_type table and make a unique index over the id type and the flag
and then make the reference from tbl_data to tbl_data_type use the type id
and flag as a foreign key instead of just type id.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings