Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Bret Hughes
On Thu, 2005-03-03 at 00:41, Michael Glaesemann wrote: > > On Mar 3, 2005, at 14:42, Bret Hughes wrote: > > > also my first two pgsql functions :) > > > > cat ts2int.sql > > FWIW, there's a patch in the queue for 8.1 that adds a to_timestamp > function that converts between Unix epoch and times

Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Bret Hughes
On Thu, 2005-03-03 at 00:25, Tom Lane wrote: > Bret Hughes <[EMAIL PROTECTED]> writes: > > create function int2ts(integer) returns timestamp as ' > > SELECT ( TIMESTAMP WITH TIME ZONE \'epoch\' + $1 * INTERVAL \'1 > > second\')::timestamp without time zone; > > ' language sql; > > > create functi

[SQL] how to monitor the archiving process?

2005-03-02 Thread Smit
Hello, i am using postgreSQL 8.0.1. i wanted to archive the WAL files. i had set the 'archive_command' variable in the posgresql.conf file as archive_command = 'cp -i %p /mnt/server/archivedir/%f' but its not working. can anybody tell me, is there anything else which should be done and i missed

Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Michael Glaesemann
On Mar 3, 2005, at 14:42, Bret Hughes wrote: also my first two pgsql functions :) cat ts2int.sql FWIW, there's a patch in the queue for 8.1 that adds a to_timestamp function that converts between Unix epoch and timestamp with time zone. http://momjian.postgresql.org/cgi-bin/pgpatches2 Doesn't hel

Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Tom Lane
Bret Hughes <[EMAIL PROTECTED]> writes: > create function int2ts(integer) returns timestamp as ' > SELECT ( TIMESTAMP WITH TIME ZONE \'epoch\' + $1 * INTERVAL \'1 > second\')::timestamp without time zone; > ' language sql; > create function ts2int(timestamp without time zone) returns int as ' > s

Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Bret Hughes
On Wed, 2005-03-02 at 14:26, Tom Lane wrote: > Bret Hughes <[EMAIL PROTECTED]> writes: > > Thanks for the feed back tom I say that but I could not believe that I > > have to jump through all those hoops on an insert or update > > > update mytable set (lasttime =(SELECT TIMESTAMP WITH TIME ZONE 'e

[SQL] Building a database from a flat file

2005-03-02 Thread Casey T. Deccio
A database I am currently using is built and updated periodically from a flat csv file (The situation is rather unfortunate, but that's all I have right now). The schema I use is more complex than the flat file, so I follow a process to populate the tables with the data from the file. First I slu

Re: [SQL] Postgres performance

2005-03-02 Thread Ian Barwick
On Wed, 02 Mar 2005 09:00:14 -0600, Scott Marlowe <[EMAIL PROTECTED]> wrote: (...) > The reason PostgreSQL is slower is because it (and by extension the team > behind it) cares about your data. > > Here's a list of the things MySQL will gladly do wrong: > > http://sql-info.de/mysql/gotchas.html

Re: [SQL] Postgres performance

2005-03-02 Thread Andrew Sullivan
This sort of discussion should really go onto -performance, but I'm at pains to stomp out a common misperception. On Wed, Mar 02, 2005 at 10:45:38PM +0100, PFC wrote: > > Sure, postgres is (a bit but not much) slower for a simple > query like SELECT * FROM one table WHERE id=some numb

Re: [SQL] Postgres performance

2005-03-02 Thread Scott Marlowe
On Wed, 2005-03-02 at 15:45, PFC wrote: > > The reason PostgreSQL is slower is because it (and by extension the team > > behind it) cares about your data. > > Sure, postgres is (a bit but not much) slower for a simple query like > SELECT * FROM one table WHERE id=some number, and postgres

Re: [SQL] Postgres performance

2005-03-02 Thread PFC
The reason PostgreSQL is slower is because it (and by extension the team behind it) cares about your data. Sure, postgres is (a bit but not much) slower for a simple query like SELECT * FROM one table WHERE id=some number, and postgres is a lot slower for UPDATES (although I heard that it's f

Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Tom Lane
Bret Hughes <[EMAIL PROTECTED]> writes: > Thanks for the feed back tom I say that but I could not believe that I > have to jump through all those hoops on an insert or update > update mytable set (lasttime =(SELECT TIMESTAMP WITH TIME ZONE 'epoch' + > 982384720 * INTERVAL '1 second') ) > is this

Re: [SQL] definative way to place secs from epoc into timestamp

2005-03-02 Thread Bret Hughes
On Wed, 2005-03-02 at 13:52, Tom Lane wrote: > Bret Hughes <[EMAIL PROTECTED]> writes: > > I give up. I have STFW and STFM and still do not feel like I have a > > good way to update/insert into a timestamp w/o TZ column with an integer > > representing seconds from epoch. > > The docs say: > >

Re: [SQL] definative way to place secs from epoc into timestamp column

2005-03-02 Thread Tom Lane
Bret Hughes <[EMAIL PROTECTED]> writes: > I give up. I have STFW and STFM and still do not feel like I have a > good way to update/insert into a timestamp w/o TZ column with an integer > representing seconds from epoch. The docs say: Here is how you can convert an epoch value back to a time st

Re: [SQL] psql encoding problem

2005-03-02 Thread T E Schmitz
Hello Ragnar, Ragnar Hafstað wrote: On Mon, 2005-02-28 at 20:48 +, T E Schmitz wrote: INSERT INTO item (name,retail_price) VALUES ('Cheese Soufflé',7.95,); psql comes back with "invalid byte sequence for encoding "UNICODE": 0xe9" might be the client encoding. set client_encoding='LATIN1'; so

[SQL] definative way to place secs from epoc into timestamp column

2005-03-02 Thread Bret Hughes
I give up. I have STFW and STFM and still do not feel like I have a good way to update/insert into a timestamp w/o TZ column with an integer representing seconds from epoch. I am adding functionality to a php app that does a fair amount of work with time and am currently using abstime($timestamp)

Re: [SQL] table constraints

2005-03-02 Thread Casey T. Deccio
On Tue, 2005-03-01 at 09:56 -0700, Greg Patnude wrote: > foreign keys and primary keys have to be defined as unique at the > table / > column level if you want to implement a check constraint -- your > contrived > example doesn't stand up all that well -- If you want to use > constraints -- > then

Re: [SQL] Postgres performance

2005-03-02 Thread Scott Marlowe
On Tue, 2005-03-01 at 04:52, mauro wrote: > > Not always, AFAICT. The four most common reasons why PG tests slower > > than Mysql are: > > 1. You haven't configured or have misconfigured PostgreSQL. > > 2. You are testing a MySQL-tuned application (lots of small, simple > > queries, no views, no

Re: [SQL] Multiples schemas

2005-03-02 Thread Peter Eisentraut
Am Mittwoch, 2. MÃrz 2005 12:30 schrieb [EMAIL PROTECTED]: > Could I create a multi schema into another schema ??? or is there only one > level for schema sctructs? No and yes. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)

Re: [SQL] psql encoding problem

2005-03-02 Thread Joel Fradkin
I had the same issue using odbc, but .net you can use encodeing = unicode, so not sure what you are using to do the connection. Since I am using ODBC with my ASP I had to switch from Unicode to SQL_ASCHII for my data base. In effect it tells the database you don’t know about the encoding and makes

Re: [SQL] Postgres performance

2005-03-02 Thread Richard Huxton
Mauro Bertoli wrote: Hi Richard, thank you for your apreciated answers!!! - start quote - Well, do you care whether your data is consistent or not? If not, you don't need transactions. - end quote - I don't require transaction because the query aren't complex and update a single tuple (in SELEC

[SQL] Multiples schemas

2005-03-02 Thread lucas
Hi, Is there a way to construct a multi schema in my data base? Something like: mysystem.finances.money.tables mysystem.finances.money.functions mysystem.finances.credits.tables mysystem.finances.credits.functions mysystem.amount.products.. Or can I use another database like:

Re: [SQL] Postgres performance

2005-03-02 Thread Richard Huxton
Mauro Bertoli wrote: Hi, thanks a lot! you are rigth, but I did read your message ;) Yes, 1- I misconfigured PostgreSQL (I thought that was already configured in base to the released version - Fedora Core 3 64bit). 2- The bench is, clearly after your precisations, an MySQL tuned application tests.

Re: [SQL] Postgres performance

2005-03-02 Thread Richard Huxton
mauro wrote: Not always, AFAICT. The four most common reasons why PG tests slower than Mysql are: 1. You haven't configured or have misconfigured PostgreSQL. 2. You are testing a MySQL-tuned application (lots of small, simple queries, no views, no subselects etc) 3. You are only testing one conne

Re: [SQL] Postgres performance

2005-03-02 Thread Michael Fuhr
On Tue, Mar 01, 2005 at 02:52:31AM -0800, mauro wrote: > select_range_key2 89224 > select_range_prefix 89054 > update_of_primary_key_many_keys 20495 These look suspect, especially the first two, and they account for over 78% of the total. D

Re: [SQL] psql encoding problem

2005-03-02 Thread Ragnar Hafstað
On Mon, 2005-02-28 at 20:48 +, T E Schmitz wrote: > INSERT INTO item (name,retail_price) VALUES ('Cheese Soufflé',7.95,); > > (I presume you see the accented character in *Soufflé*) > > psql comes back with "invalid byte sequence for encoding "UNICODE": 0xe9" > If I do this via DbVisualizer