Lists: | pgsql-jdbc |
---|
From: | Carlos Correia <carlos(at)m16e(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | When to close a Statement |
Date: | 2006-02-15 13:03:16 |
Message-ID: | 43F32694.1050005@m16e.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
After having had some problems with JDBC statements, as I mentioned in a
previous post, due to different behaviours between versions 7.x and 8.x
in the way Postgres deals with statements, I would like to know what is
the proper way of dealing with this.
I realized that the need to close the statement is implementaion
dependent, and now I'm a bit confused as I can't find anything in
Postgres docs about this issue... so the questions are:
- - must I close the statement after *every* executeXXX method call?
- - should I also close the connection as well, or may I leave it open
during the application execution?
Thanks,
Carlos
- --
MEMÓRIA PERSISTENTE, Lda.
Tel.: 219 291 591 - GSM: 967 511 762
e-mail: geral(at)m16e(dot)com - URL: http://www.m16e.com
AIM: m16e - ICQ: 257488263 - Jabber: m16e(at)amessage(dot)de
Skype.com username (VoIP): m16e.com
GnuPG: wwwkeys.eu.pgp.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFD8yaU90uzwjA1SJURAsyhAJ9twvK/oeZXrq/SEyoR9TaGr3ZNdQCgwaBC
H3eHaRZdHmZ3FuIhs/xgDIs=
=UI89
-----END PGP SIGNATURE-----
From: | Markus Schaber <schabi(at)logix-tt(dot)com> |
---|---|
To: | Carlos Correia <carlos(at)m16e(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: When to close a Statement |
Date: | 2006-02-15 13:23:20 |
Message-ID: | 43F32B48.8080104@logix-tt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hi, Carlos,
Carlos Correia wrote:
> After having had some problems with JDBC statements, as I mentioned in a
> previous post, due to different behaviours between versions 7.x and 8.x
> in the way Postgres deals with statements, I would like to know what is
> the proper way of dealing with this.
>
> I realized that the need to close the statement is implementaion
> dependent, and now I'm a bit confused as I can't find anything in
> Postgres docs about this issue... so the questions are:
>
> - must I close the statement after *every* executeXXX method call?
No, only close it if you don't need it any more.
But reusing a statement closes the ResultSet from the last query used
with this statement. The same is for begin/abort/commit.
> - should I also close the connection as well, or may I leave it open
> during the application execution?
Keep it open as long as possible (or use a connection pool), because
reopening a connection is slow.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
From: | Carlos Correia <carlos(at)m16e(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: When to close a Statement |
Date: | 2006-02-15 13:41:12 |
Message-ID: | 43F32F78.5050209@m16e.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Achilleus Mantzios escreveu:
| O Carlos Correia έγραψε στις Feb 15, 2006 :
|
|
| Hi,
|
| After having had some problems with JDBC statements, as I mentioned in a
| previous post, due to different behaviours between versions 7.x and 8.x
| in the way Postgres deals with statements, I would like to know what is
| the proper way of dealing with this.
|
| I realized that the need to close the statement is implementaion
| dependent, and now I'm a bit confused as I can't find anything in
| Postgres docs about this issue... so the questions are:
|
| - must I close the statement after *every* executeXXX method call?
|
| - should I also close the connection as well, or may I leave it open
| during the application execution?
|
|
|> Close a statement when you dont need it any more.
|> e.g.
|> PreparedStatement neinsst=con.prepareStatement("insert into
|> sparecasesdets(scid,no,descr,qty_obd,qty_req,drgno,partno)
|> VALUES(?,?,?,?,?,?,?)");
|
|> java.util.Enumeration en = request.getParameterNames();
|
|> for (;en.hasMoreElements();) {
|
|> String str_no=(String) en.nextElement();
|> boolean isdascd = str_no.startsWith("no_dascdid");
|> .....
|> neinsst.setInt(1,Integer.parseInt(scid));
|> .....
|> int rc = neinsst.executeUpdate();
|> ....
|> }
|> neinsst.close();
|
I haven't fully test it with PreparedStatement yet, but with normal
statements -- the ones you get after calling connection's
createStatement() -- after several executeXXX() calls I get an
SQLException saying "the connection has been closed" (this problem only
occurs with PostgreSQL v8.x in Windows -- I haven't been able to test in
Linux yet -- with v. 7.x I haven't notice such problems).
Thanks,
Carlos
- --
MEM?RIA PERSISTENTE, Lda.
Tel.: 219 291 591 - GSM: 967 511 762
e-mail: geral(at)m16e(dot)com - URL: http://www.m16e.com
AIM: m16e - ICQ: 257488263 - Jabber: m16e(at)amessage(dot)de
Skype.com username (VoIP): m16e.com
GnuPG: wwwkeys.eu.pgp.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFD8y9490uzwjA1SJURAvixAKCuXSPDP3FPdxV9med+wGsh70QrBQCgr9ax
qDq8B8xu5D43aqFNaY1EA44=
=cqL5
-----END PGP SIGNATURE-----
From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | Carlos Correia <carlos(at)m16e(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: When to close a Statement |
Date: | 2006-02-15 14:21:05 |
Message-ID: | Pine.LNX.4.44.0602151615310.23408-100000@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
O Carlos Correia έγραψε στις Feb 15, 2006 :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> After having had some problems with JDBC statements, as I mentioned in a
> previous post, due to different behaviours between versions 7.x and 8.x
> in the way Postgres deals with statements, I would like to know what is
> the proper way of dealing with this.
>
> I realized that the need to close the statement is implementaion
> dependent, and now I'm a bit confused as I can't find anything in
> Postgres docs about this issue... so the questions are:
>
> - - must I close the statement after *every* executeXXX method call?
>
> - - should I also close the connection as well, or may I leave it open
> during the application execution?
Close a statement when you dont need it any more.
e.g.
PreparedStatement neinsst=con.prepareStatement("insert into
sparecasesdets(scid,no,descr,qty_obd,qty_req,drgno,partno)
VALUES(?,?,?,?,?,?,?)");
java.util.Enumeration en = request.getParameterNames();
for (;en.hasMoreElements();) {
String str_no=(String) en.nextElement();
boolean isdascd = str_no.startsWith("no_dascdid");
.....
neinsst.setInt(1,Integer.parseInt(scid));
.....
int rc = neinsst.executeUpdate();
....
}
neinsst.close();
>
> Thanks,
>
> Carlos
> - --
> MEMΓRIA PERSISTENTE, Lda.
> Tel.: 219 291 591 - GSM: 967 511 762
> e-mail: geral(at)m16e(dot)com - URL: http://www.m16e.com
> AIM: m16e - ICQ: 257488263 - Jabber: m16e(at)amessage(dot)de
> Skype.com username (VoIP): m16e.com
> GnuPG: wwwkeys.eu.pgp.net
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFD8yaU90uzwjA1SJURAsyhAJ9twvK/oeZXrq/SEyoR9TaGr3ZNdQCgwaBC
> H3eHaRZdHmZ3FuIhs/xgDIs=
> =UI89
> -----END PGP SIGNATURE-----
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
--
-Achilleus
From: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | In or Exists? |
Date: | 2006-02-15 14:36:10 |
Message-ID: | OF7ED5CB03.6C08F1B7-ONC1257116.004FF4F1-C1257116.00506D6B@devoteam.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hello,
According to you, What it better to use, the IN or EXISTS predicat?
I saw on internet it's better to use EXITS . but I would like to have
another point of view..
Thanks in advance
Fabrice
+---------------------------------------------------------------------+
About Devoteam:
Devoteam is an IT consulting group.
Combining consulting and technology solutions offers enables
Devoteam to provide its customers with independent advice and
effective solutions to align their information system's technical
infrastructure with their operational objectives.
The group achieved a turnover of 199 million euros in 2005
an operating margin of 7% and counts 2,100 employees through
12 European countries and the Middle East.
Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
www.devoteam.com
+---------------------------------------------------------------------+
From: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org> |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 15:11:48 |
Message-ID: | OFFC3D0C18.64061176-ONC1257116.0053562F-C1257116.0053B0B2@devoteam.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Thank for your answer!
I use 7.3. I think it the same between 7.4 and 7.3?
Fabrice
Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Envoyé par : pgsql-jdbc-owner(at)postgresql(dot)org
15/02/2006 16:57
A
Fabrice(dot)Sznajderman(at)devoteam(dot)com
cc
pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org>
Objet
Re: [JDBC] In or Exists?
O Fabrice(dot)Sznajderman(at)devoteam(dot)com έγραψε στις Feb 15, 2006 :
> Hello,
>
> According to you, What it better to use, the IN or EXISTS predicat?
>
> I saw on internet it's better to use EXITS . but I would like to have
> another point of view..
>
> Thanks in advance
Prior to 7.4 IN was a looser,
in 7.4 IN sometimes is by far a clear winner,
i dunno in 8.*
>
>
> Fabrice
>
> +---------------------------------------------------------------------+
> About Devoteam:
>
> Devoteam is an IT consulting group.
> Combining consulting and technology solutions offers enables
> Devoteam to provide its customers with independent advice and
> effective solutions to align their information system's technical
> infrastructure with their operational objectives.
> The group achieved a turnover of 199 million euros in 2005
> an operating margin of 7% and counts 2,100 employees through
> 12 European countries and the Middle East.
> Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
> IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
> www.devoteam.com
> +---------------------------------------------------------------------+
>
--
-Achilleus
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
From: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org> |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 15:36:22 |
Message-ID: | OF9C12211D.2DC8B709-ONC1257116.005545B1-C1257116.0055F03E@devoteam.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
I know I know I too behind!
But for this moment my project manager wants to stay with this version...
There is lot specific developpement around this version ... it not easy to
change the version...
I asked to my project manager : we must upgrade !! he answser me.. not for
this moment!
so!!.... :-(
thank a lot for your answer!
Fabrice
Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Envoyé par : pgsql-jdbc-owner(at)postgresql(dot)org
15/02/2006 17:19
A
Fabrice(dot)Sznajderman(at)devoteam(dot)com
cc
Objet
Re: [JDBC] In or Exists?
O Fabrice(dot)Sznajderman(at)devoteam(dot)com έγραψε στις Feb 15, 2006 :
> Thank for your answer!
>
> I use 7.3. I think it the same between 7.4 and 7.3?
No in 7.3 exists wins.
Why are you so behind?
>
>
>
>
> Fabrice
>
>
>
>
>
> Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
> EnvoyΓ© par : pgsql-jdbc-owner(at)postgresql(dot)org
> 15/02/2006 16:57
>
> A
> Fabrice(dot)Sznajderman(at)devoteam(dot)com
> cc
> pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org>
> Objet
> Re: [JDBC] In or Exists?
>
>
>
>
>
>
> O Fabrice(dot)Sznajderman(at)devoteam(dot)com ΞΞ³ΟΞ±ΟΞ΅ ΟΟΞΉΟ Feb 15, 2006 :
>
> > Hello,
> >
> > According to you, What it better to use, the IN or EXISTS predicat?
> >
> > I saw on internet it's better to use EXITS . but I would like to have
> > another point of view..
> >
> > Thanks in advance
>
> Prior to 7.4 IN was a looser,
> in 7.4 IN sometimes is by far a clear winner,
> i dunno in 8.*
>
> >
> >
> > Fabrice
> >
> >
+---------------------------------------------------------------------+
> > About Devoteam:
> >
> > Devoteam is an IT consulting group.
> > Combining consulting and technology solutions offers enables
> > Devoteam to provide its customers with independent advice and
> > effective solutions to align their information system's technical
> > infrastructure with their operational objectives.
> > The group achieved a turnover of 199 million euros in 2005
> > an operating margin of 7% and counts 2,100 employees through
> > 12 European countries and the Middle East.
> > Listed on the Euronext Paris Nouveau Marche and part of the
Nexteconomy,
> > IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
> > www.devoteam.com
> >
+---------------------------------------------------------------------+
> >
>
>
--
-Achilleus
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
From: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 15:48:49 |
Message-ID: | 1140018529.22740.213.camel@state.g2switchworks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
On Wed, 2006-02-15 at 09:36, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> I know I know I too behind!
> But for this moment my project manager wants to stay with this
> version...
>
> There is lot specific developpement around this version ... it not
> easy to change the version...
>
> I asked to my project manager : we must upgrade !! he answser me.. not
> for this moment!
>
> so!!.... :-(
>
> thank a lot for your answer!
Just make sure you're running the latest version of 7.3.x. Earlier
versions of 7.3 had some data loss issues if I remember correctly. It's
always a good practice to be running the latest patch level of your
version of PostgreSQL.
From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org> |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 15:57:32 |
Message-ID: | Pine.LNX.4.44.0602151756230.23644-100000@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
O Fabrice(dot)Sznajderman(at)devoteam(dot)com έγραψε στις Feb 15, 2006 :
> Hello,
>
> According to you, What it better to use, the IN or EXISTS predicat?
>
> I saw on internet it's better to use EXITS . but I would like to have
> another point of view..
>
> Thanks in advance
Prior to 7.4 IN was a looser,
in 7.4 IN sometimes is by far a clear winner,
i dunno in 8.*
>
>
> Fabrice
>
> +---------------------------------------------------------------------+
> About Devoteam:
>
> Devoteam is an IT consulting group.
> Combining consulting and technology solutions offers enables
> Devoteam to provide its customers with independent advice and
> effective solutions to align their information system's technical
> infrastructure with their operational objectives.
> The group achieved a turnover of 199 million euros in 2005
> an operating margin of 7% and counts 2,100 employees through
> 12 European countries and the Middle East.
> Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
> IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
> www.devoteam.com
> +---------------------------------------------------------------------+
>
--
-Achilleus
From: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 15:59:14 |
Message-ID: | OFCCD46667.4E5397E1-ONC1257116.00576240-C1257116.0058085C@devoteam.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
thank you for your answer!
how I can know the version of my postgres DataBase ?
I know is 7.3.x but I don't know for the 'x' number ..
Thanks a lot in advance!
Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Envoyé par : pgsql-jdbc-owner(at)postgresql(dot)org
15/02/2006 16:48
A
Fabrice(dot)Sznajderman(at)devoteam(dot)com
cc
Objet
Re: [JDBC] In or Exists?
On Wed, 2006-02-15 at 09:36, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> I know I know I too behind!
> But for this moment my project manager wants to stay with this
> version...
>
> There is lot specific developpement around this version ... it not
> easy to change the version...
>
> I asked to my project manager : we must upgrade !! he answser me.. not
> for this moment!
>
> so!!.... :-(
>
> thank a lot for your answer!
Just make sure you're running the latest version of 7.3.x. Earlier
versions of 7.3 had some data loss issues if I remember correctly. It's
always a good practice to be running the latest patch level of your
version of PostgreSQL.
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
+---------------------------------------------------------------------+
About Devoteam:
Devoteam is an IT consulting group.
Combining consulting and technology solutions offers enables
Devoteam to provide its customers with independent advice and
effective solutions to align their information system's technical
infrastructure with their operational objectives.
The group achieved a turnover of 199 million euros in 2005
an operating margin of 7% and counts 2,100 employees through
12 European countries and the Middle East.
Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
www.devoteam.com
+---------------------------------------------------------------------+
From: | Markus Schaber <schabi(at)logix-tt(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:07:39 |
Message-ID: | 43F351CB.403@logix-tt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hi, Fabrice,
Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> how I can know the version of my postgres DataBase ?
> I know is 7.3.x but I don't know for the 'x' number ..
use psql or another command line tool, and send the query
SELECT VERSION();
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org> |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:19:12 |
Message-ID: | Pine.LNX.4.44.0602151818450.23682-100000@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
O Fabrice(dot)Sznajderman(at)devoteam(dot)com έγραψε στις Feb 15, 2006 :
> Thank for your answer!
>
> I use 7.3. I think it the same between 7.4 and 7.3?
No in 7.3 exists wins.
Why are you so behind?
>
>
>
>
> Fabrice
>
>
>
>
>
> Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
> EnvoyΓ© par : pgsql-jdbc-owner(at)postgresql(dot)org
> 15/02/2006 16:57
>
> A
> Fabrice(dot)Sznajderman(at)devoteam(dot)com
> cc
> pgsql-jdbc(at)postgresql(dot)org, <pgsql-jdbc-owner(at)postgresql(dot)org>
> Objet
> Re: [JDBC] In or Exists?
>
>
>
>
>
>
> O Fabrice(dot)Sznajderman(at)devoteam(dot)com ΞΞ³ΟΞ±ΟΞ΅ ΟΟΞΉΟ Feb 15, 2006 :
>
> > Hello,
> >
> > According to you, What it better to use, the IN or EXISTS predicat?
> >
> > I saw on internet it's better to use EXITS . but I would like to have
> > another point of view..
> >
> > Thanks in advance
>
> Prior to 7.4 IN was a looser,
> in 7.4 IN sometimes is by far a clear winner,
> i dunno in 8.*
>
> >
> >
> > Fabrice
> >
> > +---------------------------------------------------------------------+
> > About Devoteam:
> >
> > Devoteam is an IT consulting group.
> > Combining consulting and technology solutions offers enables
> > Devoteam to provide its customers with independent advice and
> > effective solutions to align their information system's technical
> > infrastructure with their operational objectives.
> > The group achieved a turnover of 199 million euros in 2005
> > an operating margin of 7% and counts 2,100 employees through
> > 12 European countries and the Middle East.
> > Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
> > IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
> > www.devoteam.com
> > +---------------------------------------------------------------------+
> >
>
>
--
-Achilleus
From: | John R Pierce <pierce(at)hogranch(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:24:54 |
Message-ID: | 43F355D6.7030207@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
>
> thank you for your answer!
>
>
> how I can know the version of my postgres DataBase ?
> I know is 7.3.x but I don't know for the 'x' number ..
$ psql --version
psql (PostgreSQL) 8.1.2
...
or...
$ psql --version
psql (PostgreSQL) 7.4.5
(two different machines here)
this just shows the version of psql itself, which SHOULD be the same as
your server version. if you want to confirm this,
$ psql -c "show server_version;"
server_version
----------------
7.4.5
(1 row)
From: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:27:13 |
Message-ID: | 1140020833.22740.215.camel@state.g2switchworks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
On Wed, 2006-02-15 at 09:59, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> thank you for your answer!
>
>
> how I can know the version of my postgres DataBase ?
> I know is 7.3.x but I don't know for the 'x' number ..
psql -V will tell you the client version. or psql template1 -c "select
version();" will tell you the version of the backend server.
From: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:27:56 |
Message-ID: | OFC84DB0F0.F081C57C-ONC1257116.005A4A86-C1257116.005AA8F9@devoteam.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
I tried select version();
it gave me this:
PostgreSQL 7.2.3-RH on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2
20020903 (Red Hat Linux 8.0 3.2-7)
I really newbie with postgres...
Can u help me?
thank in advance!!
Fabrice
Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Envoyé par : pgsql-jdbc-owner(at)postgresql(dot)org
15/02/2006 17:27
A
Fabrice(dot)Sznajderman(at)devoteam(dot)com
cc
Objet
Re: [JDBC] In or Exists?
On Wed, 2006-02-15 at 09:59, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> thank you for your answer!
>
>
> how I can know the version of my postgres DataBase ?
> I know is 7.3.x but I don't know for the 'x' number ..
psql -V will tell you the client version. or psql template1 -c "select
version();" will tell you the version of the backend server.
---------------------------(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
+---------------------------------------------------------------------+
About Devoteam:
Devoteam is an IT consulting group.
Combining consulting and technology solutions offers enables
Devoteam to provide its customers with independent advice and
effective solutions to align their information system's technical
infrastructure with their operational objectives.
The group achieved a turnover of 199 million euros in 2005
an operating margin of 7% and counts 2,100 employees through
12 European countries and the Middle East.
Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
www.devoteam.com
+---------------------------------------------------------------------+
From: | Markus Schaber <schabi(at)logix-tt(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:41:49 |
Message-ID: | 43F359CD.3060106@logix-tt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hi, Fabrice,
Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
>
> I tried select version();
>
> it gave me this:
>
> PostgreSQL 7.2.3-RH [...]
This tells us that you use a Redhat specific PostgreSQL version 7.2, dot
release 7.2.3.
7.2 is pretty old, and not supported by the PostgreSQL team any more
(since the 8.1 release, AFAIR.)
And even for 7.2, 7.2.8 is the newest dot release.
You can fetch it from
ftp://ftp.de.postgresql.org/mirror/postgresql/binary/OLD/
or other postgresql mirrors.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
From: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 16:48:18 |
Message-ID: | 1140022097.22740.222.camel@state.g2switchworks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
On Wed, 2006-02-15 at 10:27, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> I tried select version();
>
> it gave me this:
>
> PostgreSQL 7.2.3-RH on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
> 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
OK... You're running a really really old version of PostgreSQL.
It has known data loss and crash inducing bugs.
Let your boss know that you should upgrade to, at a minimum, the latest
version of 7.2, which is 7.2.8.
7.2 is no longer supported. It's very old. It's creaky in fact. I
would recommend upgrading to the latest 8.0 or 8.1 series, or 7.4 as a
minimum.
Many IT managers prefer to stick with older "known" versions of
software. While I understand this, it's really mostly a comfort issue.
And nothing makes me more uncomfortable than a database error that means
all my data just disappeared.
Oh, and update your OS as well if you can. RH 8.0 is also no longer
supported. It has many unpatched security bugs. You are running an
unreliable, unstable version of postgresql on an unreliable, insecure
platform. Expect no mercy from the gods or the members of this list
when things go wrong. And they will.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> |
Cc: | Fabrice(dot)Sznajderman(at)devoteam(dot)com, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 17:35:36 |
Message-ID: | 14501.1140024936@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Scott Marlowe <smarlowe(at)g2switchworks(dot)com> writes:
> On Wed, 2006-02-15 at 10:27, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
>> PostgreSQL 7.2.3-RH on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
>> 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
> OK... You're running a really really old version of PostgreSQL.
In fact, it's so old that I can't even find any trace in Red Hat's
internal CVS of such a version having been released :-(. AFAICT, RHL 8
shipped with Postgres 7.3. I think that this very probably isn't an
official Red Hat RPM at all, but something that was built locally using
already-obsolete Postgres sources.
Upgrade *now*, don't wait to get burnt. And I concur with Scott about
upgrading the whole OS while you're at it.
regards, tom lane
From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 17:56:55 |
Message-ID: | Pine.BSO.4.63.0602151255140.15692@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
On Wed, 15 Feb 2006, Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
> According to you, What it better to use, the IN or EXISTS predicat?
>
This questino has nothing to do with Java or JDBC and is not appropriate
for this list. Please send future questions of this sort to
pgsql-general(at)postgresql(dot)org(dot) Also do not include the list owner email
address. This address is only for problems with the list itself like
subscribing or unsubscribing, not for general questions.
Kris Jurka
From: | John R Pierce <pierce(at)hogranch(dot)com> |
---|---|
To: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-15 18:34:52 |
Message-ID: | 43F3744C.7060103@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
> Oh, and update your OS as well if you can. RH 8.0 is also no longer
> supported. It has many unpatched security bugs. You are running an
> unreliable, unstable version of postgresql on an unreliable, insecure
> platform.
indeed. The 'proper' upgrade is a clean install of a up to date
supported distribution, perhaps RHEL4 or CentOS4, or perhaps something
else, however I also know how hard this can be on a production system.
There is an alternative, the Fedora people have a 'fedora legacy'
project which is still supporting RH9 with critical fixes, you can
fairly easily update RH8 to RH9 (they are very similar systems), and
then get the latest updates for this platform.
This will give you some breathing room while you plan the major upgrade
to RHEL4 or something else...
I've done this on some production servers where there was lack of money
or resources to setup a whole new server (these are servers that belong
to 3rd parties for which noone is being paid to run, so there were no
resources available for a proper upgrade).
I would first dump backups of all your postgres databases(!!) Then I'd
make backups of all your core file systems so you can revert if things
backfire on you for unexplained reasons...
then, follow these instructions...
http://www.fedora.us/wiki/LegacyRPMUpgrade
and then these...
http://www.fedoralegacy.org/docs/yum-rh9.php
then remove any and all traces of RH distributions of older postgres
versions (`rpm -qa | grep postgres`, then rpm -e xxxx), install the
latest postgres 8.1 from the RPMs on the postgres download pages, and
recreate your postgres users, and restore your postgres dump, and you
should be good to go.
From: | Fabrice(dot)Sznajderman(at)devoteam(dot)com |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, pgsql-jdbc-owner(at)postgresql(dot)org |
Subject: | Re: In or Exists? |
Date: | 2006-02-17 10:15:40 |
Message-ID: | OFCD3767A6.1327CBA9-ONC1257118.00387143-C1257118.003893E1@devoteam.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hello,
Thanks a lot for this information! I think I 'll upgrade my environnement
!
Thank for the link to!!!
best regards
Fabrice
Markus Schaber <schabi(at)logix-tt(dot)com>
Envoyé par : pgsql-jdbc-owner(at)postgresql(dot)org
15/02/2006 17:41
A
Fabrice(dot)Sznajderman(at)devoteam(dot)com
cc
Objet
Re: [JDBC] In or Exists?
Hi, Fabrice,
Fabrice(dot)Sznajderman(at)devoteam(dot)com wrote:
>
> I tried select version();
>
> it gave me this:
>
> PostgreSQL 7.2.3-RH [...]
This tells us that you use a Redhat specific PostgreSQL version 7.2, dot
release 7.2.3.
7.2 is pretty old, and not supported by the PostgreSQL team any more
(since the 8.1 release, AFAIR.)
And even for 7.2, 7.2.8 is the newest dot release.
You can fetch it from
ftp://ftp.de.postgresql.org/mirror/postgresql/binary/OLD/
or other postgresql mirrors.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org
www.nosoftwarepatents.org
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
+---------------------------------------------------------------------+
About Devoteam:
Devoteam is an IT consulting group.
Combining consulting and technology solutions offers enables
Devoteam to provide its customers with independent advice and
effective solutions to align their information system's technical
infrastructure with their operational objectives.
The group achieved a turnover of 199 million euros in 2005
an operating margin of 7% and counts 2,100 employees through
12 European countries and the Middle East.
Listed on the Euronext Paris Nouveau Marche and part of the Nexteconomy,
IT CAC, IT CAC 50, SBF 250 index of Euronext Paris.
www.devoteam.com
+---------------------------------------------------------------------+