[GENERAL] fun in redmond

2001-09-26 Thread tony


"Microsoft adds Java support to database
Microsoft is planning to make available software for linking Java
programs to its database software. The Redmond, Wash., behemoth said
Tuesday that it will sell software that allows Java programs to connect
to data housed in Microsoft's SQL Server 2000 database. Microsoft is
licensing the software, called a Java Database Connectivity (JDBC)
driver, from software maker Merant and re-branding it under the
Microsoft name."


Isn't that a laugh. Microsoft supporting a non standard connection
method... I thought that asp was a nice secure protocol for connecting
web applications to SQL server =:-D

Cheers

Tony Grant


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [GENERAL] Multibyte FAQ item

2001-09-26 Thread tony

On Wed, 2001-09-26 at 06:22, Tom Lane wrote:

> > This really comes down to the point that multibyte, unicode, and locale
> > should be the defaults.  People generally object to this on performance
> > grounds, but that reminds me of the saying, "I can make this code
> > arbitrarily fast if it doesn't have to give the right answer."
> 
> A fair point ...
> 
> > Nor do I believe these claims, btw.
> 
> Has anyone done any measurements of performance with/without these
> options?  I know I haven't.

Would be rather silly in my case because all my base are belong to
French locale...

=:-D

Cheers

Tony Grant


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[GENERAL] Fastest way to load data in a table

2001-09-26 Thread Antonio Navarro Navarro

Hi all.

I need to clean and fill periodically a database with several hundred thousands
records readed from a plain ascii file.

I have a Python script that opens the file and then, after a 'DELETE *
FROM table'  submits an INSERT for each registry, but this process is very slow.

How can I accelerate this uploading process ?

Best regards,

Antonio Navarro Navarro  
BemarNet Management
http://www.bemarnet.es
[EMAIL PROTECTED]



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[GENERAL] Perl and Postgres

2001-09-26 Thread Brian C. Doyle

Hello all,

Where can I look to find out more about developing a web based interface 
via Perl.. Currently I do it all via PHP but do to resources available for 
a project I have I need to convert over to perl.. I check the Postgres 
Doc's and there were no examples to help get me started.  Any thing 
appreciated.



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [GENERAL] fun in redmond

2001-09-26 Thread wsheldah



What was wrong with JDBC::ODBC?  I don't use Java, but I thought this solution
was out there for a while already?  Just not db-specific enough for them?




tony <[EMAIL PROTECTED]> on 09/26/2001 04:09:32 AM

To:   postgres list <[EMAIL PROTECTED]>
cc:(bcc: Wesley Sheldahl/Lex/Lexmark)
Subject:  [GENERAL] fun in redmond



"Microsoft adds Java support to database
Microsoft is planning to make available software for linking Java
programs to its database software. The Redmond, Wash., behemoth said
Tuesday that it will sell software that allows Java programs to connect
to data housed in Microsoft's SQL Server 2000 database. Microsoft is
licensing the software, called a Java Database Connectivity (JDBC)
driver, from software maker Merant and re-branding it under the
Microsoft name."


Isn't that a laugh. Microsoft supporting a non standard connection
method... I thought that asp was a nice secure protocol for connecting
web applications to SQL server =:-D

Cheers

Tony Grant


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])





---(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: [GENERAL] postgresql.conf

2001-09-26 Thread Mihai Gheorghiu

Thank you very much.
Actually, it was the optimization parameters that I was interested in. My db
works rather slow even in single user mode and I wondered if I had missed
some setup. BTW, is there a way to see what parameters are in effect?

-Original Message-
From: Lamar Owen <[EMAIL PROTECTED]>
To: Mihai Gheorghiu <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Tuesday, September 25, 2001 8:30 PM
Subject: Re: [GENERAL] postgresql.conf


>On Tuesday 25 September 2001 11:34 am, Mihai Gheorghiu wrote:
>> I installed PG from RPMs. postgresql.conf comes with all options
commented
>> out.
>> What are the defaults? PG works anyway (Well... I know... -i etc.)
>> Thank you all.
>
>All options commented out is the installation default of a from-source
>install as well as the RPM install.  The default values for the various
>paramters are commented inside the file, IIRC.
>
>Use tcpip_socket=true instead of -i
>
>I made the conscious decision to ship the default postgresql.conf -- what
>optimizations should I make?  I can't make generalized optimizations -- so
I
>ship the default file.
>--
>Lamar Owen
>WGCR Internet Radio
>1 Peter 4:11


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

http://archives.postgresql.org



Re: [GENERAL] JDBC update wont, plz help.

2001-09-26 Thread Barry Lind

Vic,

Can you post the errors you are getting for both the build problem and 
the runtime problem you originally reported?

Without the exact errors you are getting, I can only guess at the 
problems you are encountering.  But my guess as to your original problem 
is that your code is trying to use updateable result sets which the 
driver does not support.

I wouldn't bother trying to build the EE version of the driver.  It 
doesn't have very much additional functionality (it only impliments a 
small subset of javax.sql), and I doubt that is the source of your 
original problem.

thanks,
--Barry

Vic Cekvneich wrote:

> I downloaded the 7.13 src and did a JDBC build using J2EE 13, to get the 
> sqlX package.
> The build failed with errors.
> 
> Is there someone who can make a build with sqlX java (must have J2EE SDK
> enviroment) ?
> Help.. please
> Vic
> 
> Vic Cekvenich wrote:
> 
>> I am dead in the water 
>>  > I used a driver from http://jdbc.fastcrypt.com/ , the latest driver I
>>
>>> could find w/ JDK1.3 and a simple CachedRowSet from SUN Devlopers 
>>> connection.
>>>
>>> It will not update via AcceptChages.
>>> Error is This methos is not yet implementd.
>>>
>>> Can someone help me update a tabe using JDBC plz? Please cc 
>>> [EMAIL PROTECTED]
>>>
>>> TIA,
>>> Vic
>>>
>>> PS:
>>> My source code:
>>>
>>> import sun.jdbc.rowset.*;
>>> // get it from Java Developer's Connection
>>> // or look at Appendix Download
>>> import java.sql.*;
>>> import org.postgresql.*;
>>>
>>> public class pimRDB {
>>> public static void main (String args[])
>>> {
>>> try
>>> {
>>>
>>> CachedRowSet crs = new CachedRowSet();
>>> // row set is better than ResultSet,
>>> // configure driver, read more in book JDBC Database Access  :
>>> Class.forName("org.postgresql.Driver");
>>> crs.setUrl("jdbc:postgresql://localhost/template1");
>>> // yours should not be localhost, but
>>> //an IP address of DBS server. The 5432 is the IP port
>>> crs.setUsername("sysdba");
>>>
>>> crs.setPassword("sysdba");
>>>
>>> //select
>>> crs.setCommand("select NAM from NAM where PK = ?");
>>> crs.setTableName("NAM");
>>> // use your field names
>>> crs.setInt(1, 8);
>>>
>>> // pass the first argument to the select command to
>>> // retrieve PK id of Name #8, the 8th name entered
>>> crs.execute();
>>> crs.next();
>>>
>>> //get the field value
>>> String nam = crs.getString("NAM");
>>> System.out.println(nam);
>>> // repeat
>>> crs.updateString("NAM","Vic");
>>> crs.acceptChanges();
>>> //select
>>> crs.setCommand("select NAM from NAM where PK = ?");
>>> // use your field names
>>> crs.setInt(1, 8);
>>> // pass the first argument to the select command to
>>> // retrieve PK id of Name #8, the 8th name entered
>>> crs.execute();
>>> crs.next();
>>>
>>> //get the field value
>>> nam = crs.getString("NAM");
>>> System.out.println(nam);
>>>
>>> } // try
>>> catch (Exception e)   {System.out.println(e);} // catch
>>> }// main
>>> }// class
>>> //Optional: Make the program take an argument
>>> //of the PK for the record it should retrieve
>>>
>>>
>>>
>>
>>
>>
>> ---
>>
>>
>>
>>
>>
>> ---(end of broadcast)---
>> TIP 2: you can get off all lists at once with the unregister command
>> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
>>
> 
> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [GENERAL] Birthsday list

2001-09-26 Thread Randal L. Schwartz

> "Svenne" == Svenne Krap <[EMAIL PROTECTED]> writes:

Svenne> I kind of found the answer myself ... here are some snipplets ...
Svenne> the table and the data :


Svenne> CREATE SEQUENCE "friends_friendid_seq" start 1 increment 1 maxvalue
Svenne> 2147483647 minvalue 1  cache 1 ;

Svenne> CREATE TABLE "friends" (
Svenne> "friendid" integer DEFAULT
Svenne> nextval('"friends_friendid_seq"'::text) NOT NULL,
Svenne> "friendname" character varying,
Svenne> "dateofbirth" timestamp with time zone,
Svenne> Constraint "friends_pkey" Primary Key ("friendid")
Svenne> );

Svenne> COPY "friends"  FROM stdin;
Svenne> 1   Tony1978-01-28 00:00:00+01
Svenne> 2   Gary1966-06-04 00:00:00+01
Svenne> 3   Jodie   1979-01-11 00:00:00+01
Svenne> \. 


Svenne> My query, works but looks clumbersome.. can it be made smarter ?

Svenne> select * from (
Svenne> (select *,date_part('year',now()) - date_part('year', dateofbirth) as
Svenne> age,  date_part('doy',dateofbirth)-date_part('doy',now()) as daystogo
Svenne> from friends where date_part('doy',dateofbirth) >=
Svenne> date_part('doy',now()))
Svenne> union
Svenne> (select *,date_part('year',now()) - date_part('year', dateofbirth ) +1
Svenne> as age, date_part('doy',dateofbirth)-date_part('doy',now()) +
Svenne> date_part('day', (now() + '1 year'::interval)::timestamp -  now()) as
Svenne> daystogo from friends where date_part('doy',dateofbirth) <
Svenne> date_part('doy',now(
Svenne>  r order by r.daystogo

yeah, how about a little modular arithmetic?

select friendname, dateofbirth from friends
order by (366 + date_part('doy', dateofbirth) - date_part('doy', now())) % 366;

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]