Re: [SQL] Automated Backup

2003-09-19 Thread A.Bhuvaneswaran
> Is there a way to automate the backup databases using pg_dump (like in > SQL server)? You can use cron to automate your backup process with pg_dump. regards, bhuvaneswaran ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Datafiles for Databases

2003-09-19 Thread A.Bhuvaneswaran
> Will the postgres create individual data file for databases? Yes. > How to get the datafile path of a database? /var/lib/pgsql/data/base/, database directory name = pg_database.oid. You can also use oid2name contrib module for finer detail. regards, bhuvaneswaran ---

Re: [SQL] is this explain good or bad???

2003-09-19 Thread ries
Here are the explain analyze versions: Best regards and thanx in advance Ries explain analyze select count(*) from sq_logfile; NOTICE: QUERY PLAN: Aggregate (cost=35988.07..35988.07 rows=1 width=0) (actual time=71907.64..71907.64 rows=1 loops=1) -> Seq Scan on sq_logfile (cost=0.00..3349

Re: [SQL] virus warning

2003-09-19 Thread Richard Huxton
On Friday 19 September 2003 07:17, Tomasz Myrta wrote: > Hi > Recently I receive massive mail attack. This attack comes from some > postgresql mailing list users. All send-to adresses are taken from users > mailboxes which contain postgresql posts. Currently I found two kinds of > viruses: > 1. Emp

Re: [SQL] virus warning

2003-09-19 Thread Paul Thomas
On 19/09/2003 07:17 Tomasz Myrta wrote: Hi Recently I receive massive mail attack. This attack comes from some postgresql mailing list users. All send-to adresses are taken from users mailboxes which contain postgresql posts. Currently I found two kinds of viruses: 1. Empty post with "Undelivere

Re: [SQL] virus warning

2003-09-19 Thread Tomasz Myrta
So far I've had nearly 150 of these in the last 12 hours or so. Somebody on these lists has a lot of explaining to do! Fortunately my spam filters are up to scratch and I run Linux :) Others may not be so lucky. Currently I've found 45 different Return-Path values in these posts and it's growing

Re: [SQL] Automated Backup

2003-09-19 Thread Christopher Browne
Oops! [EMAIL PROTECTED] ("Kumar") was seen spray-painting on a wall: > Is there a way to automate the backup databases using pg_dump (like in SQL server)? If you can come up with a way of automating the running of programs, then I imagine that might be possible. I have heard that a program called

Re: [SQL] virus warning

2003-09-19 Thread Christopher Browne
The world rejoiced as [EMAIL PROTECTED] (Richard Huxton) wrote: > I've been getting something similar myself. Roughly 100 per day. Only 100, eh? I have been seeing that many per hour, give or take... -- "aa454","@","freenet.carleton.ca" http://cbbrowne.com/info/x.html People can be set wondering

Re: [SQL] Datafiles for Databases

2003-09-19 Thread Christopher Browne
In the last exciting episode, [EMAIL PROTECTED] ("Kumar") wrote: > I was looking for a structure like oracle or ms Sql server in Postgres. What I have > expected is individual > datafiles for individual databases. But i cant fine such items in the > /usr/local/pgsql/data directory. > > Will the p

Re: [SQL] virus warning

2003-09-19 Thread Rudi Starcevic
Hi, Yeah me too - about 150 so far today. I was thinking it's from my Debian mailing lists not PostgreSQL. Strange people these stpid virus spammers. Good luck with it all. Regards Rudi. ---(end of broadcast)--- TIP 6: Have you searched our li

[SQL] Backup of multiple tables

2003-09-19 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I usually backup my database with pg_backup without the -t option. But now I need to only backup certain tables(say tab1 and tab2), is this possible with pg_dump? I've tried with "pg_dump -t tab1 -t tab2" without success. - -- Andreas Joseph K

Re: [SQL] virus warning

2003-09-19 Thread Tomasz Myrta
The world rejoiced as [EMAIL PROTECTED] (Richard Huxton) wrote: I've been getting something similar myself. Roughly 100 per day. Only 100, eh? I have been seeing that many per hour, give or take... If it will help someone, I found that The Microsoft Virus is called "Swen" or "Gibe". It attacks

[SQL] Problem with timestamp - Pls help

2003-09-19 Thread Kumar
Dear Friends,   I am using Postgres 7.3.4 on Linux server 7.3.   I wanted to update one column of my table with now() or timestamp. And I want that timestamp of format  2003-09-19 18:39:08.13   To achieve this I have used the following   wats=# select now();  

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Tomasz Myrta
Dear Friends, I am using Postgres 7.3.4 on Linux server 7.3. I wanted to update one column of my table with now() or timestamp. And I want that timestamp of format 2003-09-19 18:39:08.13 To achieve this I have used the following wats=# select now();

[SQL] restoring dbschema

2003-09-19 Thread Richard Sydney-Smith
I have a database created with pg 7.3.1 In pgAdminII I have saved the DBSchema   After creating a  new database in pgAdmin I opened a SQL box and loaded the dbschema.sql file and tried to run  it.   A number of errors occured. The first was that the public namespace was already defined this

Re: [SQL] Backup of multiple tables

2003-09-19 Thread Alexander M. Pravking
On Fri, Sep 19, 2003 at 01:54:01PM +0200, Andreas Joseph Krogh wrote: > I usually backup my database with pg_backup without the -t option. But now I > need to only backup certain tables(say tab1 and tab2), is this possible with > pg_dump? I've tried with "pg_dump -t tab1 -t tab2" without success.

Re: [SQL] Backup of multiple tables

2003-09-19 Thread Alexander M. Pravking
On Fri, Sep 19, 2003 at 04:30:57PM +0200, Andreas Joseph Krogh wrote: > > Here's a perl script I used to dump all the tables separately. > > I'm not sure most of options do work there, I didn't test ;-) > > It won't be hard to make it dump certain tables, I think. > > Thanks for your suggestion, b

Re: [SQL] Backup of multiple tables

2003-09-19 Thread Tom Lane
Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > I usually backup my database with pg_backup without the -t option. But now I > need to only backup certain tables(say tab1 and tab2), is this possible with > pg_dump? I've tried with "pg_dump -t tab1 -t tab2" without success. pg_dump can only ha

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Stephan Szabo
On Fri, 19 Sep 2003, Kumar wrote: > Dear Friends, > > I am using Postgres 7.3.4 on Linux server 7.3. > > I wanted to update one column of my table with now() or timestamp. And I want that > timestamp of format > 2003-09-19 18:39:08.13 I think select CAST(CURRENT_TIMEST

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Tom Lane
"Kumar" <[EMAIL PROTECTED]> writes: > I wanted to update one column of my table with now() or timestamp. And I wa= > nt that timestamp of format > 2003-09-19 18:39:08.13 It sounds like you simply want to limit the fractional precision of the value. Why don't you just dec

Re: [SQL] virus warning

2003-09-19 Thread scott.marlowe
On Fri, 19 Sep 2003, Paul Thomas wrote: > > On 19/09/2003 07:17 Tomasz Myrta wrote: > > Hi > > Recently I receive massive mail attack. This attack comes from some > > postgresql mailing list users. All send-to adresses are taken from users > > mailboxes which contain postgresql posts. Currently

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Stephan Szabo
On Fri, 19 Sep 2003, Stephan Szabo wrote: > On Fri, 19 Sep 2003, Kumar wrote: > > > Dear Friends, > > > > I am using Postgres 7.3.4 on Linux server 7.3. > > > > I wanted to update one column of my table with now() or timestamp. And I want that > > timestamp of format > >

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > I think select CAST(CURRENT_TIMESTAMP(0) AS timestamp without time zone) > may get you what you want without having to rely on the text format. If you don't want the time zone, there's also LOCALTIMESTAMP(n). See http://www.postgresql.org/docs/7.3/stati

[SQL] psql output and password Qs

2003-09-19 Thread ow
Hi, 1) When psql is run from a script, how would one save *all* output generated by psql (including errors, info messages, etc) in to a file?. I tried redirecting output with ">" but that did not save error/confirmation messages. 2) When psql is run from a script, how would one pass a password to

Re: [SQL] psql output and password Qs

2003-09-19 Thread Oliver Elphick
On Fri, 2003-09-19 at 19:47, ow wrote: > Hi, > > 1) When psql is run from a script, how would one save *all* output generated by > psql (including errors, info messages, etc) in to a file?. I tried redirecting > output with ">" but that did not save error/confirmation messages. Standard output an

Re: [SQL] virus warning

2003-09-19 Thread Paul Thomas
On 19/09/2003 16:37 scott.marlowe wrote: Keep in mind, if you check the headers on the emails you'll see that they are forged. I've been getting about 20 emails a day telling me a message I know I didn't send was infected with a virus. I got 432 last night inbound, some with names forged from t

Re: [SQL] virus warning

2003-09-19 Thread Yasir Malik
Thank god that I use Pine. Yasir On Fri, 19 Sep 2003, Paul Thomas wrote: > Date: Fri, 19 Sep 2003 23:14:54 +0100 > From: Paul Thomas <[EMAIL PROTECTED]> > To: "pgsql-sql @ postgresql . org" <[EMAIL PROTECTED]> > Subject: Re: [SQL] virus warning > > On 19/09/2003 16:37 scott.marlowe wrote: > > > >

[SQL] DBschema restore

2003-09-19 Thread Richard Sydney-Smith
An example problem...The dbschema file contains the following section ( which causes several errors)-- Function: public.today()CREATE FUNCTION public.today() RETURNS date AS 'select current_date;'  LANGUAGE 'sql' VOLATILE;-- View: public.todayCREATE VIEW public.today AS SELECT today() A

[SQL] auto_increment

2003-09-19 Thread Muhyiddin A.M Hayat
How to Create auto_increment field in PostreSQL. Can I create them using Trigger.

Re: [SQL] auto_increment

2003-09-19 Thread Oliver Elphick
On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote: > How to Create auto_increment field in PostreSQL. > Can I create them using Trigger. Use the SERIAL datatype. See also the functions nextval(), currval() and setval(). -- Oliver Elphick[EMAIL PROTECTED] Isl

[SQL] Error with functions

2003-09-19 Thread shyamperi
Hey, create or replace function sample(varchar,int) returns varchar as' declare data alias for $1; size alias for $2; begin return substr(data,(length(data)-size)+1,length(data)); end; ' language 'plpgsql'; WARNING: plpgsql: ERROR during compil