[SQL] Is login_cnt is reserved attribute name?
Hi i did nothing but changed attribute name from 'login_cnt' to 'cnt_login' and my update stmt started working? I am using DBD::Pg + postgresql 7.2.1 i will try to produce a test case. regds mallah. -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [SQL] contrib/dblink suggestion
dblink is fine to use, and will continue to be shipped with PostgreSQL. Not sure where you heard about problems with it. --- Bhuvan A wrote: > Hi, > > I am using postgresql 7.2.1. > I badly require to interconnect between databases. contrib/dblink seems to > be handy and ofcourse it well suits my requirement. But while browsing > across, i heard that it is not advicable to use it. So i wish to know > someone's experience in using dblink and how handy it is. > > Will contrib/dblink be available with future postgresql releases? Valuable > suggestions are very welcome. > > TIA. > > regards, > bhuvaneswaran > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [SQL] contrib/dblink suggestion
Bhuvan A wrote: > I am using postgresql 7.2.1. > I badly require to interconnect between databases. contrib/dblink seems to > be handy and ofcourse it well suits my requirement. But while browsing > across, i heard that it is not advicable to use it. So i wish to know > someone's experience in using dblink and how handy it is. > > Will contrib/dblink be available with future postgresql releases? Valuable > suggestions are very welcome. > I've heard of at least two people who seem to be using dblink fairly heavily without problems. One recently reported something like 500 million records transferred without error. I use it myself, but not in what I'd call heavy use. If you are aware of any specific problems, please point me to them, and I'll fix them before the next release. Thanks, Joe ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[SQL] Delete a FOREIGN KEY
Hi All, I'm beginner in PostgreSQL! So, how can I delete a FOREIGN KEY in PostgreSQL? Thanks. Marcelo Henrique da Silva.
Re: [SQL] Returning PK of first insert for second insert use.
You need to do something like this: SELECT proj_id FROM t_proj WHERE oid=xxx; To find value of primary key from oid. Chris > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Peter Atkins > Sent: Tuesday, 30 July 2002 2:33 AM > To: '[EMAIL PROTECTED]' > Subject: [SQL] Returning PK of first insert for second insert use. > > > All, > > I have two tables t_proj, t_task see below: > > CREATE TABLE t_proj ( > proj_id SERIAL NOT NULL, > PRIMARY KEY (proj_id), > task_id integer(12), > user_id integer(6), > title varchar(35), > description varchar(80) > ); > > CREATE TABLE t_task ( > task_id SERIAL NOT NULL, > PRIMARY KEY (task_id), > title varchar(35), > description varchar(80) > ); > > When I insert into t_task I need to return the task_id (PK) for > that insert > to be used for the insert into the t_proj table. > > I tried using RESULT_OID but I have no idea how to obtain the > true PK using > this opague id. Below is the procedure I tried to use. > > CREATE OR REPLACE FUNCTION insertTask (varchar, varchar) > RETURNS INTEGER AS ' > > DECLARE > -- local variables > oid1 INTEGER; > retval INTEGER; > > BEGIN > INSERT INTO t_task (title, description) VALUES ($1, $2); > > -- Get the oid of the row just inserted. > GET DIAGNOSTICS oid1 = RESULT_OID; > > retval := oid1; > > -- Everything has passed, return id as pk > RETURN retval; > END; > ' LANGUAGE 'plpgsql'; > > > Any help would be great! > > Thanks Again, > -p > > > > ---(end of broadcast)--- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] > ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] Delete a FOREIGN KEY
On Tue, 30 Jul 2002, Marcelo Henrique da Silva wrote: > Hi All, > > I'm beginner in PostgreSQL! > So, how can I delete a FOREIGN KEY in PostgreSQL? You'll need to drop the triggers related to the foreign key. You might want to look at the referential integrity documents on techdocs.postgresql.org. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] COUNT DISTINCT?
On Tue, 30 Jul 2002, Josh Berkus wrote: > Folks, > > Anybody know a keen shortcut for the following: > > SELECT count(skip_date) > FROM (SELECT DISTINCT skip_date FROM weekend_list > WHERE ... ...) days_to_skip; > > That's a double aggregate, and is bound to be dog-slow. Would that be the same as: select count(distinct skip_date) from weekend_list where ... ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] COUNT DISTINCT?
Stephan, > Would that be the same as: > select count(distinct skip_date) from weekend_list > where ... Yeah, that would be what I was looking for. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[SQL] formating numeric values
Hello all! I have some doubts about numeric formating. The default formating for numeric values are "." as decimal representation and "," as milion separation. How can I change ###,###.&& to ###.###,&& .. A Question... Since before your sun burned hot in space and before your race was born, I have awaited a question. Elielson Fontanezi DBA Technical Support - PRODAM Parque do Ibirapuera s/n - SP - BRAZIL +55 11 5080 9493 ---(end of broadcast)--- TIP 3: 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] contrib/dblink suggestion
Dear Mr.Joe Conway, Thank you very much for your suggestion. Really nowhere i got to know about specific problem in dblink. But some discussions had went on this mailing list long back and here is that link http://archives.postgresql.org/pgsql-sql/2002-05/msg7.php Anyway thank you once again. regards, bhuvaneswaran On Tue, 30 Jul 2002, Joe Conway wrote: > Bhuvan A wrote: > > I am using postgresql 7.2.1. > > I badly require to interconnect between databases. contrib/dblink seems to > > be handy and ofcourse it well suits my requirement. But while browsing > > across, i heard that it is not advicable to use it. So i wish to know > > someone's experience in using dblink and how handy it is. > > > > Will contrib/dblink be available with future postgresql releases? Valuable > > suggestions are very welcome. > > > > I've heard of at least two people who seem to be using dblink fairly > heavily without problems. One recently reported something like 500 > million records transferred without error. I use it myself, but not in > what I'd call heavy use. > > If you are aware of any specific problems, please point me to them, and > I'll fix them before the next release. > > Thanks, > > Joe > ---(end of broadcast)--- TIP 3: 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