Re: [SQL] About pg_dump

2004-03-11 Thread Rute Solipa
hi,

i had to restore a database from a pg_dump and i'm having problems with the
encoding.
it seems that the pg_dump command doesn't keep the encoding information.
does anybody can help me resolve this problem.

thanks

rute



- Original Message -
From: "Daniel Henrique Alves Lima" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 10, 2004 11:00 PM
Subject: [SQL] About pg_dump


> Hi, everybody !
>
> I don't know if this is the best list to ask this question but if it
> doesn't, please forgive me (should i try pgsl-general, maybe ?)...
> We have a postgresql database in production and i've 2 questions
> about pg_dumpall boring me. We "dump" both ddl and data as SQL commands,
> so :
>
> 1. Does the created sql script respect the database encoding (will
> chars be writen as utf-8 chars or iso-8859-1 char or ...) ?
> 2. We've a bytea in one table. What exactly happens with the dumped
> data ? Is there any trouble with it ?
>
> I believe that we must to worry now (earlier). I don't want to
> expect until we must to restore database backup to descover that dumping
> data is corrupted :-)
>
>
>  Thanks in advance 
>
>
> ---(end of broadcast)---
> TIP 7: don't forget to increase your free space map settings
>
>



---(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] randomized order in select?

2004-03-11 Thread scott.marlowe
On Thu, 11 Mar 2004, Iain wrote:

> If you have a lot of tips, you could create a unique indexed tip number
> column. Select the highest tip number using:
> 
> select tip_number from tips order by tip_number desc limit 1;
> 
> Then generate a random number and select using that tip_number.
> 
> Of course, you would have to allow for the possibility of missing tip
> numbers, by repeating the random number generation/read sequence until you
> find something. Since the tip_number isn't the PK of the table, you can
> regenerate the tip numbers to eliminate holes from deletions any time you
> like. Just reset the sequence to 1 and update all rows with the
> nextval(tipnumber_seq).
> 
> Sounds like a lot of work to me though...

Assuming there are ten rows, you can use this:

select * from table limit 1 offset random()*10;



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


Re: [SQL] About pg_dump

2004-03-11 Thread Tom Lane
"Rute Solipa" <[EMAIL PROTECTED]> writes:
> it seems that the pg_dump command doesn't keep the encoding information.

As of 7.4.2 it does emit a SET client_encoding.

In prior releases, if you are manually creating the destination database
then you need to be careful to create it with the same encoding as before.

regards, tom lane

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


Re: [SQL] designer tool connect to PostgreSQL

2004-03-11 Thread scott.marlowe
On Thu, 11 Mar 2004 [EMAIL PROTECTED] wrote:

> Hi,
> 
>   thanks to all for the responnd...i've look into all the tools mentioned 
> and found many tools which has a great feautre such as designing/modelling
> the object/table but it seems look like that there is no tools that can do 
> the ETL process. thanks in advance

from a google search for postgresql and etl:

http://www.safe.com/news/2003/sept16_2003.htm
http://cloveretl.berlios.de/

There may be others, I'm not sure.


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

   http://archives.postgresql.org


Re: [SQL] Break a report in Run Time

2004-03-11 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thursday 11 March 2004 9:11 am, Jander wrote:
>  I need to abort the SQL process running in DB Server.
>

If you are in psql, you can cancel any query with CTRL-C. Otherwise, you 
can kill the process running the query using the "kill" command. If that 
doesn't work you can kill (but not -9!) the backend process handling your 
query.

>
> - Original Message -
> From: "Jonathan Gardner" <[EMAIL PROTECTED]>
> To: "Jander" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 10, 2004 6:09 PM
> Subject: Re: [SQL] Break a report in Run Time
>
> > On Wednesday 10 March 2004 10:23 am, Jander wrote:
> > >I have a application with a lof of reports. I need
> > > to break a report in Run Time. How can I do this?
> >
> > Could you clarify what you mean by "break a report in run time"?
> >
> > --
> > Jonathan Gardner
> > [EMAIL PROTECTED]
> >
> > ---(end of
> > broadcast)--- TIP 4: Don't 'kill -9' the
> > postmaster

- -- 
Jonathan Gardner
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAUJIpqp6r/MVGlwwRAi8eAJ4q9UHzimQtlR3I+XdGICvfF8ZfbgCdHU6q
77RNJ+5WBwAwrZ1pbD+7meg=
=BsCQ
-END PGP SIGNATURE-

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


[SQL] trace facility

2004-03-11 Thread beyaNet Consultancy
Is there a trace facility that i can use with postgreSQL 7.3.4, ala 
SQLServer 2000?

many thanks in advance

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


Re: [SQL] Break a report in Run Time

2004-03-11 Thread Jonathan Gardner
On Thursday 11 March 2004 10:08 am, Jander wrote:
> I need to abort the SQL process inside my application developed in Kylix.
>

Go read the documentation for Kylix. I don't know the environment at all. I 
do know that if you are calling the query in a blocking manner then the 
only way to stop it is to kill the entire process, or set a timeout or 
something.

> - Original Message -
> From: "Jonathan M. Gardner" <[EMAIL PROTECTED]>
> To: "Jander" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, March 11, 2004 12:22 PM
> Subject: Re: [SQL] Break a report in Run Time
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > On Thursday 11 March 2004 9:11 am, Jander wrote:
> > >  I need to abort the SQL process running in DB Server.
> >
> > If you are in psql, you can cancel any query with CTRL-C. Otherwise,
> > you can kill the process running the query using the "kill" command. If
> > that doesn't work you can kill (but not -9!) the backend process
> > handling your query.
> >
> > > - Original Message -
> > > From: "Jonathan Gardner" <[EMAIL PROTECTED]>
> > > To: "Jander" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, March 10, 2004 6:09 PM
> > > Subject: Re: [SQL] Break a report in Run Time
> > >
> > > > On Wednesday 10 March 2004 10:23 am, Jander wrote:
> > > > >I have a application with a lof of reports. I need
> > > > > to break a report in Run Time. How can I do this?
> > > >
> > > > Could you clarify what you mean by "break a report in run time"?
> > > >
> > > > --
> > > > Jonathan Gardner
> > > > [EMAIL PROTECTED]
> > > >
> > > > ---(end of
> > > > broadcast)--- TIP 4: Don't 'kill -9' the
> > > > postmaster
> >
> > - --
> > Jonathan Gardner
> > [EMAIL PROTECTED]
> > -BEGIN PGP SIGNATURE-
> > Version: GnuPG v1.2.3 (GNU/Linux)
> >
> > iD8DBQFAUJIpqp6r/MVGlwwRAi8eAJ4q9UHzimQtlR3I+XdGICvfF8ZfbgCdHU6q
> > 77RNJ+5WBwAwrZ1pbD+7meg=
> > =BsCQ
> > -END PGP SIGNATURE-

-- 
Jonathan Gardner
[EMAIL PROTECTED]

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [SQL] About pg_dump

2004-03-11 Thread Daniel Henrique Alves Lima
   I've made a test and it seems ok to me. I'm using utf-8 encoding 
under postgresql 7.3.3.

Tom Lane wrote:

"Rute Solipa" <[EMAIL PROTECTED]> writes:
 

it seems that the pg_dump command doesn't keep the encoding information.
   

As of 7.4.2 it does emit a SET client_encoding.

In prior releases, if you are manually creating the destination database
then you need to be careful to create it with the same encoding as before.
			regards, tom lane

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



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


[SQL] IMPORT TOOL

2004-03-11 Thread Louie Kwan
Hi All,

Do anyone of you aware of any PG import tool same as SQL*LOADER in ORACLE

We are doing some DataWarehouse work and need to import a large set of data
from csv files.

We are trying a import tool from ems-hitech.com, but I have troubles when
loading time and date columns.

Any help is much appreciated.

Thanks
Louie

-- |  Creating NNM_HOST Table
-- |

CREATE TABLE NNM_NODES (
 lastLoadTime_e   DATE,
 domain_name  VARCHAR(10),
 
 ovtopo_idINTEGER   NOT NULL,
 node_typeVARCHAR(10),
 node_nameVARCHAR(30),
 ov_statusVARCHAR(10),
 ipaddressVARCHAR(15)
);
data.csv

31/01/2004,D1H01,845,IP,dfrQCQCRD1,Normal,142.130.35.1
31/01/2004,D1H01,849,IP,dfrQCIMCP1,Normal,142.130.130.33
31/01/2004,D1H01,853,IP,dfrQCSIBL1,Normal,142.130.130.19

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

   http://www.postgresql.org/docs/faqs/FAQ.html


[SQL] Problems with tsearch2: ERROR: datumGetSize: Invalid typLen 0

2004-03-11 Thread postgres

Hi all -

I'm playing with tsearch2. It built and installed normally (this is PG 7.3.2 
on an Alpha running Debian Stable, with the December 18th tsearch2), and 
portions of it work, but, for instance ts_tsvector doesn't:

jal=# select to_tsvector('default', 'Our first string used today first 
string');
ERROR:  datumGetSize: Invalid typLen 0

Archive searches didn't seem to turn anything up... Has anyone seen this
before?

-j

-- 
Jamie Lawrence[EMAIL PROTECTED]
The fact that technology doesn't work is no bar to success in 
the marketplace.
   - Philip Greenspun



---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [SQL] IMPORT TOOL

2004-03-11 Thread Chris Browne
[EMAIL PROTECTED] (Louie Kwan) writes:
> Do anyone of you aware of any PG import tool same as SQL*LOADER in ORACLE
>
> We are doing some DataWarehouse work and need to import a large set of data
> from csv files.
>
> We are trying a import tool from ems-hitech.com, but I have troubles when
> loading time and date columns.
>
> Any help is much appreciated.
>
> Thanks
> Louie
>
> -- |  Creating NNM_HOST Table
> -- |
>
> CREATE TABLE NNM_NODES (
>  lastLoadTime_e   DATE,
>  domain_name  VARCHAR(10),
>  
>  ovtopo_idINTEGER   NOT NULL,
>  node_typeVARCHAR(10),
>  node_nameVARCHAR(30),
>  ov_statusVARCHAR(10),
>  ipaddressVARCHAR(15)
> );
> data.csv
> 
> 31/01/2004,D1H01,845,IP,dfrQCQCRD1,Normal,142.130.35.1
> 31/01/2004,D1H01,849,IP,dfrQCIMCP1,Normal,142.130.130.33
> 31/01/2004,D1H01,853,IP,dfrQCSIBL1,Normal,142.130.130.19

At this point, the 'equivalent' to SQL*LOADER is some combination of
Perl, Python, Tcl, or some other favorite scripting language.

I seem to recall that someone (he'll remain nameless :-)) was working
on a tool rather like this; I'm not sure where deployment of that
stands.
-- 
output = ("cbbrowne" "@" "ntlug.org")
http://www3.sympatico.ca/cbbrowne/advocacy.html
"SCSI is *NOT* magic. There are *fundamental technical reasons* why it
is necessary  to sacrifice  a young  goat to your  SCSI chain  now and
then."

---(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