[SQL] Function Syntax Help

2009-10-30 Thread Plugge, Joe R.
I am trying to create a function that will grind through a cdr table and 
populate another table.  I am trying to load the function and am getting the 
following error:


ERROR:  function result type must be specified





CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) AS 
$$ DECLARE

mycount integer;

BEGIN

WHILE mystart < mystop + INTERVAL '1 day' LOOP

SELECT INTO mycount  count(*) FROM log_calls WHERE startdate < mystart and 
enddate > mystop;

INSERT INTO simultaneous_calls_rpt (startdate,call_count) VALUES 
(mystart,mycount);

mystart := mystart + INTERVAL '1 minute';

mystop  := mystop + INTERVAL '1 minute';

END LOOP;

END;

$$ LANGUAGE 'plpgsql' STABLE;








[cid:image002.jpg@01CA596B.59B9EC10]Joe R. Plugge
Database Administrator, West Interactive Corporation
11650 Miracle Hills Drive, Omaha NE 68154
402-716-0349 | Cell 402-517-2710 | jrplu...@west.com

This electronic message transmission, including any attachments, contains 
information from West Corporation which may be confidential or privileged. The 
information is intended to be for the use of the individual or entity named 
above. If you are not the intended recipient, be aware that any disclosure, 
copying, distribution or use of the contents of this information is prohibited.

If you have received this electronic transmission in error, please notify the 
sender immediately by a "reply to sender only" message and destroy all 
electronic and hard copies of the communication, including attachments.
<><>

Re: [SQL] Function Syntax Help

2009-10-30 Thread Plugge, Joe R.
Thanks Brian, I changed it to this:

CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) 
RETURNS VOID AS $$
DECLARE
mycount integer;
BEGIN
WHILE mystart < mystop + INTERVAL '1 day' LOOP
SELECT INTO mycount  count(*) FROM log_calls WHERE startdate < mystart and 
enddate > mystop;
INSERT INTO simultaneous_calls_rpt (startdate,call_count) VALUES 
(mystart,mycount);
mystart := mystart + INTERVAL '1 minute';
mystop  := mystop + INTERVAL '1 minute';
END LOOP;
END;
$$ LANGUAGE 'plpgsql' STABLE;

But now am getting a different error:

[postg...@linux1559 ~]$ cat gen_simultaneous_calls.sql | psql holly
ERROR:  "$1" is declared CONSTANT
CONTEXT:  compilation of PL/pgSQL function "gen_simultaneous_calls" near line 7



From: epai...@googlemail.com [mailto:epai...@googlemail.com] On Behalf Of Brian 
Modra
Sent: Friday, October 30, 2009 2:29 PM
To: Plugge, Joe R.
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Function Syntax Help

2009/10/30 Plugge, Joe R. mailto:jrplu...@west.com>>
I am trying to create a function that will grind through a cdr table and 
populate another table.  I am trying to load the function and am getting the 
following error:


ERROR:  function result type must be specified





CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) AS 
$$ DECLARE

you need to tell it the return type. If there is none, "returns void"

e.g.
 CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) 
returns void AS $$

mycount integer;

BEGIN

WHILE mystart < mystop + INTERVAL '1 day' LOOP

SELECT INTO mycount  count(*) FROM log_calls WHERE startdate < mystart and 
enddate > mystop;

INSERT INTO simultaneous_calls_rpt (startdate,call_count) VALUES 
(mystart,mycount);

mystart := mystart + INTERVAL '1 minute';

mystop  := mystop + INTERVAL '1 minute';

END LOOP;

END;

$$ LANGUAGE 'plpgsql' STABLE;








Joe R. Plugge
Database Administrator, West Interactive Corporation
11650 Miracle Hills Drive, Omaha NE 68154
402-716-0349 | Cell 402-517-2710 | jrplu...@west.com<mailto:jrplu...@west.com>

This electronic message transmission, including any attachments, contains 
information from West Corporation which may be confidential or privileged. The 
information is intended to be for the use of the individual or entity named 
above. If you are not the intended recipient, be aware that any disclosure, 
copying, distribution or use of the contents of this information is prohibited.

If you have received this electronic transmission in error, please notify the 
sender immediately by a "reply to sender only" message and destroy all 
electronic and hard copies of the communication, including attachments.



--
Brian Modra   Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/


Re: [SQL] Function Syntax Help

2009-10-30 Thread Plugge, Joe R.
Thanks, I changed my code to this, it compiled, and it seems to be running now:

CREATE OR REPLACE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop 
timestamp) RETURNS VOID AS $$
DECLARE
mycount integer;
newstart timestamp := mystart;
newstop timestamp := mystop;
BEGIN
WHILE newstart < newstop + INTERVAL '1 day' LOOP
SELECT INTO mycount  count(*) FROM log_calls WHERE startdate < newstart and 
enddate > newstop;
INSERT INTO simultaneous_calls_rpt (startdate,call_count) VALUES 
(newstart,mycount);
newstart := newstart + INTERVAL '1 minute';
newstop  := newstop + INTERVAL '1 minute';
END LOOP;
END;
$$ LANGUAGE 'plpgsql' VOLATILE;



From: epai...@googlemail.com [mailto:epai...@googlemail.com] On Behalf Of Brian 
Modra
Sent: Friday, October 30, 2009 2:46 PM
To: Plugge, Joe R.
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Function Syntax Help

2009/10/30 Plugge, Joe R. mailto:jrplu...@west.com>>
Thanks Brian, I changed it to this:

CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) 
RETURNS VOID AS $$
DECLARE
mycount integer;
BEGIN
WHILE mystart < mystop + INTERVAL '1 day' LOOP
SELECT INTO mycount  count(*) FROM log_calls WHERE startdate < mystart and 
enddate > mystop;
INSERT INTO simultaneous_calls_rpt (startdate,call_count) VALUES 
(mystart,mycount);
mystart := mystart + INTERVAL '1 minute';
mystop  := mystop + INTERVAL '1 minute';
END LOOP;
END;
$$ LANGUAGE 'plpgsql' STABLE;

But now am getting a different error:

[postg...@linux1559 ~]$ cat gen_simultaneous_calls.sql | psql holly
ERROR:  "$1" is declared CONSTANT
CONTEXT:  compilation of PL/pgSQL function "gen_simultaneous_calls" near line 7

 mystart and mystop are constants...

you could declare variables and copy those into them, and the modify the new 
variables...



From: epai...@googlemail.com<mailto:epai...@googlemail.com> 
[mailto:epai...@googlemail.com<mailto:epai...@googlemail.com>] On Behalf Of 
Brian Modra
Sent: Friday, October 30, 2009 2:29 PM
To: Plugge, Joe R.
Cc: pgsql-sql@postgresql.org<mailto:pgsql-sql@postgresql.org>
Subject: Re: [SQL] Function Syntax Help

2009/10/30 Plugge, Joe R. mailto:jrplu...@west.com>>
I am trying to create a function that will grind through a cdr table and 
populate another table.  I am trying to load the function and am getting the 
following error:


ERROR:  function result type must be specified





CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) AS 
$$ DECLARE

you need to tell it the return type. If there is none, "returns void"

e.g.
 CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp) 
returns void AS $$

mycount integer;

BEGIN

WHILE mystart < mystop + INTERVAL '1 day' LOOP

SELECT INTO mycount  count(*) FROM log_calls WHERE startdate < mystart and 
enddate > mystop;

INSERT INTO simultaneous_calls_rpt (startdate,call_count) VALUES 
(mystart,mycount);

mystart := mystart + INTERVAL '1 minute';

mystop  := mystop + INTERVAL '1 minute';

END LOOP;

END;

$$ LANGUAGE 'plpgsql' STABLE;








Joe R. Plugge
Database Administrator, West Interactive Corporation
11650 Miracle Hills Drive, Omaha NE 68154
402-716-0349 | Cell 402-517-2710 | jrplu...@west.com<mailto:jrplu...@west.com>

This electronic message transmission, including any attachments, contains 
information from West Corporation which may be confidential or privileged. The 
information is intended to be for the use of the individual or entity named 
above. If you are not the intended recipient, be aware that any disclosure, 
copying, distribution or use of the contents of this information is prohibited.

If you have received this electronic transmission in error, please notify the 
sender immediately by a "reply to sender only" message and destroy all 
electronic and hard copies of the communication, including attachments.



--
Brian Modra   Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/



--
Brian Modra   Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/


Re: [SQL] PostgreSQL Active-Active Configuration

2010-03-05 Thread Plugge, Joe R.
You may want to try Bucardo ...   By performance, are you referring to latency? 
 If so, bandwidth between sites typically is the factor with latency in any 
replication solution.

http://bucardo.org/


-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of Dave Clements
Sent: Friday, March 05, 2010 1:25 AM
To: pgsql-ad...@postgresql.org; pgsql-sql
Subject: [SQL] PostgreSQL Active-Active Configuration

Hi everyone,

I am looking for some Master-Master replication solutions for
PostgreSQL database. Please let me know if you are using one and if
you are happy with the performance.



Thanks

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

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


Re: [SQL] Simple aggregate query brain fart

2010-03-18 Thread Plugge, Joe R.
Mark, 

Change your query to this:

SELECT id, count(*) FROM mytable GROUP BY id  HAVING count(*) > 2;

-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of Mark Fenbers
Sent: Thursday, March 18, 2010 10:07 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] Simple aggregate query brain fart

I want to do:

SELECT id, count(*) FROM mytable WHERE count(*) > 2 GROUP BY id;

But this doesn't work because Pg won't allow aggregate functions in a where 
clause.  So I modified it to:

SELECT id, count(*) AS cnt FROM mytable WHERE cnt > 2 GROUP BY id;

But Pg still complains (that column cnt does not exist).  When using an 
GROUP/ORDER BY clause, I can refer to a column number (e.g., GROUP BY 1) 
instead of a column name, but how can I refer to my unnamed second column in my 
where clause?

Mark


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


Re: [SQL] understanding select into

2010-04-09 Thread Plugge, Joe R.
Johnf,



I would think that the _p, _test, _r etc are local variables within the 
procedure/function and this is the way that the value (from the select)  gets 
assigned to that local variable.



-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of John
Sent: Friday, April 09, 2010 12:19 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] understanding select into



Hi,

I am reviewing a function written by some xTuple guys.  What is interesting

about it is it uses the "INTO" statement like



select something into _p from sometable where somecriteria.



The function contiunes and uses the data retreived

_p.somefield_name



And then the function ends.





Ok my question:



I also thought the select "into" created a real table.  But after running the

function the table does not exist.  I see no where that a 'drop' is issued.

In fact the function uses lot's of select into's like (_test, _r, etc..).  So

would some kind soul explain what is happening.



Could it be that "_p" is drop automaticly when the function ends?  Something

to do with scope.



Could it have something to do with the fact the function returns only an

integer?  And that causes the table to be drop.



As you can see I'm lost here!





Johnf



--

Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)

To make changes to your subscription:

http://www.postgresql.org/mailpref/pgsql-sql


[SQL] Column Specific Update Trigger Routine

2010-05-06 Thread Plugge, Joe R.
I am trying to create a update trigger on a table that basically will only fire 
when a specific column is updated.  I am using version 8.4.3.

My plan of attack was to always fire on any row update, and pass in the OLD and 
NEW column that I want to check.

CREATE TRIGGER check_lockout
AFTER UPDATE ON acct_table
FOR EACH ROW
EXECUTE PROCEDURE 
acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);


This fails with :

[postg...@linux1505 ~]$ cat check_lockout_trig.sql | psql testdb
ERROR:  syntax error at or near "OLD"
LINE 4: EXECUTE PROCEDURE 
acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);


What am I doing wrong? Or is there a better way to go about this?





Re: [SQL] Column Specific Update Trigger Routine

2010-05-06 Thread Plugge, Joe R.
Nevermind all, I figured it out 

Thanks Dmitriy ...

From: Dmitriy Igrishin [mailto:dmit...@gmail.com]
Sent: Thursday, May 06, 2010 3:25 PM
To: Plugge, Joe R.
Subject: Re: [SQL] Column Specific Update Trigger Routine

Hey Plugge,

You dont need to pass OLD.* or NEW.* to the trigger function.
These structures available from within trigger function.
Note, that in PostgreSQL 9 you will able to create trigger
which call function only when some column of the table
affected.

Regards,
Dmitriy
2010/5/7 Plugge, Joe R. mailto:jrplu...@west.com>>
I am trying to create a update trigger on a table that basically will only fire 
when a specific column is updated.  I am using version 8.4.3.

My plan of attack was to always fire on any row update, and pass in the OLD and 
NEW column that I want to check.

CREATE TRIGGER check_lockout
AFTER UPDATE ON acct_table
FOR EACH ROW
EXECUTE PROCEDURE 
acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);


This fails with :

[postg...@linux1505 ~]$ cat check_lockout_trig.sql | psql testdb
ERROR:  syntax error at or near "OLD"
LINE 4: EXECUTE PROCEDURE 
acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);


What am I doing wrong? Or is there a better way to go about this?






Re: [SQL] Column Specific Update Trigger Routine

2010-05-06 Thread Plugge, Joe R.
This is what I have and it seems to work:


CREATE OR REPLACE FUNCTION holly_unlock() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF OLD.password != NEW.password
THEN
UPDATE hms_mtusers_rw set loginfailedcount = 0 WHERE userid = 
OLD.userid and ownerid = OLD.ownerid;
RETURN NEW;
END IF;

RETURN NULL; -- result is ignored since this is an AFTER trigger
END;
$$;


Thanks !!

From: Justin Graf [mailto:jus...@magwerks.com]
Sent: Thursday, May 06, 2010 3:59 PM
To: Plugge, Joe R.; pgsql-sql@postgresql.org
Subject: Re: [SQL] Column Specific Update Trigger Routine

On 5/6/2010 4:12 PM, Plugge, Joe R. wrote:
I am trying to create a update trigger on a table that basically will only fire 
when a specific column is updated.  I am using version 8.4.3.

My plan of attack was to always fire on any row update, and pass in the OLD and 
NEW column that I want to check.

CREATE TRIGGER check_lockout
AFTER UPDATE ON acct_table
FOR EACH ROW
EXECUTE PROCEDURE 
acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);


This fails with :

[postg...@linux1505 ~]$ cat check_lockout_trig.sql | psql testdb
ERROR:  syntax error at or near "OLD"
LINE 4: EXECUTE PROCEDURE 
acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);


What am I doing wrong? Or is there a better way to go about this?



You don't call the trigger procedure with the old and new as parameters

new and old are automatically created for the function  acct_unlock()
CREATE TRIGGER check_lockout
AFTER UPDATE ON acct_table
FOR EACH ROW
EXECUTE PROCEDURE acct_unlock();


Next the trigger function would look something like this

create or replace function acct_unlock()
returns trigger as
$$

if  (OLD.userid <> NEW.password)
do  something
end if;

$$


keep in mind the acct_unlock must be  returns trigger

Then return either NEW or the OLD record
OLD if  not changing the record or NEW if  the updated values are to be stored 
in the table.



All legitimate Magwerks Corporation quotations are sent in a .PDF file 
attachment with a unique ID number generated by our proprietary quotation 
system. Quotations received via any other form of communication will not be 
honored.

CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally 
privileged, confidential or other information proprietary to Magwerks 
Corporation and is intended solely for the use of the individual to whom it 
addresses. If the reader of this e-mail is not the intended recipient or 
authorized agent, the reader is hereby notified that any unauthorized viewing, 
dissemination, distribution or copying of this e-mail is strictly prohibited. 
If you have received this e-mail in error, please notify the sender by replying 
to this message and destroy all occurrences of this e-mail immediately.
Thank you.


Re: [SQL] how to construct sql

2010-06-02 Thread Plugge, Joe R.
This is discussed in this Wiki:


http://wiki.postgresql.org/wiki/Grouping_Sets



-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of Hiltibidal, Rob
Sent: Wednesday, June 02, 2010 12:06 PM
To: Oliveiros; Wes James; pgsql-sql@postgresql.org
Subject: Re: [SQL] how to construct sql

db2 has a group by rollup function.. does this exist in postgres?

-Original Message-
From: pgsql-sql-ow...@postgresql.org
[mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Oliveiros
Sent: Wednesday, June 02, 2010 11:55 AM
To: Wes James; pgsql-sql@postgresql.org
Subject: Re: [SQL] how to construct sql

Hi,
Have you already tried this out?

select MAX(page_count_count) - MIN(page_count_count)  
from page_count 
group by page_count_pdate.


Best,
Oliveiros

- Original Message - 
From: "Wes James" 
To: 
Sent: Wednesday, June 02, 2010 5:48 PM
Subject: [SQL] how to construct sql


>I am grabbing a printer total and putting it in a table.  The
> page_count is continuously increasing:
> 
> page_count_countpage_count_pdate
> 10   2010-05-10
> 20   2010-05-10
> 40   2010-05-11
> 60   2010-05-11
> 80   2010-05-11
> 100   2010-05-12
> 120   2010-05-12
> .
> 
> and so on.
> 
> I can do:
> 
> select sum(page_count_count) from page_count group by
page_count_pdate.
> 
> and get a total for a day.  But this is not the total I want.  I want
> the total page count for the day.  This would mean getting the first
> page count of the day and then subtracting that from last page_count
> for the day.  For 2010-05-11 above it would be
> 
> 80 - 40 = 40 total for the day.  Is there a way to do this with sql?
> 
> thx,
> 
> -wes
> 
> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

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

PRIVILEGED AND CONFIDENTIAL
This email transmission contains privileged and confidential information 
intended only for the use of the individual or entity named above.  If the 
reader of the email is not the intended recipient or the employee or agent 
responsible for delivering it to the intended recipient, you are hereby 
notified that any use, dissemination or copying of this email transmission is 
strictly prohibited by the sender.  If you have received this transmission in 
error, please delete the email and immediately notify the sender via the email 
return address or mailto:postmas...@argushealth.com.  Thank you.





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

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


Re: [SQL] Union Question

2010-12-03 Thread Plugge, Joe R.
You may want to try dblink.

http://www.postgresql.org/docs/current/static/dblink.html


From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of Shaun McCloud
Sent: Friday, December 03, 2010 10:51 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] Union Question

Hello,

I need to union three PostgreSQL tables and this won't be a problem but the 
tables are on different servers.  Basically, I have an administrative server 
that needs the tables viewable in a web administrator and three query servers 
that log the needed data locally.  Is there a way I can do this without using 
Slony-I to replicate the data to the administrative server?

Shaun McCloud - Software Testing Analyst
GeoComm Inc.
601 W. Saint Germain St., Saint Cloud, MN 56301
Office: 320.240.0040 Fax: 320.240.2389 Toll Free: 888.436.2666
click here to visit www.geo-comm.com
Microsoft Certified Desktop Support Technician (MCDST)

Do or do not, there is no try.
  -Yoda




Re: [SQL] Compare two Data bases Structure

2011-02-23 Thread Plugge, Joe R.
Check out DB Solo ...

http://www.dbsolo.com/


Does both DDL compare as well as data compare.



From: pgsql-sql-ow...@postgresql.org [pgsql-sql-ow...@postgresql.org] On Behalf 
Of manuel antonio ochoa [manuel8aalf...@gmail.com]
Sent: Wednesday, February 23, 2011 6:03 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Compare two Data bases Structure

How Can I do to compare two structures of data bases ?

DBA  != DBB I need wich functions and wich tables are not equals

thnks



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


Re: [SQL] When To Use Quotes

2012-01-05 Thread Plugge, Joe R.
Should match to the data type of the filtered value, so CHAR,VARCHAR,All DATE 
TYPES should be quoted.  INTEGER, BIGINT, SMALLINT should not 

-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of Carlos Mennens
Sent: Thursday, January 05, 2012 7:56 AM
To: PostgreSQL (SQL)
Subject: [SQL] When To Use Quotes

I'm trying to understand when in SELECT statements should and should I not use 
single quotes to filter my results. For example:

SELECT * FROM people
WHERE fname = 'James';

or

SELECT * FROM price
WHERE msrb
BETWEEN 50 AND 100;

Now is it correct to say that in PostgreSQL or ANSI SQL in general I should use 
'single quotes' when the condition is strictly a numerical data type value and 
everything else should be inside 'single quotes'?

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

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


Re: [SQL]

2013-10-08 Thread Plugge, Joe R.
1 - why two databases?  Couldn't you have just created two separate SCHEMAS?
2 - if you insist on two separate databases:   
http://www.postgresql.org/docs/9.2/static/dblink.html


From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On 
Behalf Of Kaleeswaran Velu
Sent: Tuesday, October 08, 2013 11:23 AM
To: pgsql-sql@postgresql.org
Subject: [SQL]

Hi Team,
I am using PostgreSQL 9.2.3 in Windows platform. I have created two databases 
in it. Now I want to refer the tables across the databases. Meaning would like 
to create Database link. Can anyone guide me on how to create a DB link?

Thanks and Regards
Kaleeswaran Velu