Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-17 Thread chrisj
Hi Tom, Thanks again, I did not appreciate the dual function of "AT TIME ZONE" when the input is timestamptz then the function converts from one timezone to another (not what I wanted), but when the input is timestamp the function acts more like a cast than a convert (exactly what I wanted) I

Re: [SQL][GENERAL] Any documatation about porting from Oracle to PostgreSQL

2006-10-17 Thread Lewis Cunningham
Felix, You might want to look at EnterpriseDB, which is PostgreSQL with Oracle compatibility extensions. www.enterprisedb.com LewisC --- Felix Zhang <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm a newbie of PostgreSQL. I'm searching materials about porting > from > Oracle to PostgreSQL. > Any

Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-17 Thread Tom Lane
chrisj <[EMAIL PROTECTED]> writes: > When I first saw your solution I thought it was logically going to do > (notice the parentheses): > select ('2006-07-13 09:20:00'::timestamp) at time zone 'EST5EDT'; > which does not help Well, actually, that's exactly what it does. AT TIME ZONE is an op

Fwd: Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Achilleas Mantzios
I forgot to mention that you would have to maintain a counter of each inserted row and stop when you reach 60% of N (where N the cardinality of your source table). -- Προωθημένο Μήνυμα -- Subject: Re: [SQL] [GENERAL] How to split a table? Date: Τρίτη 17 Οκτώβριος 2006 12:09 Fr

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Jorge Godoy
"Gregory S. Williamson" <[EMAIL PROTECTED]> writes: > A crude approach would be to add a column to the original table; then update > that based on the rand() call: > > update foo set i_am_a_60 = 1 where (rand() <= 0.60); > create table foo_60 as select * from foo where i_am_a_60 = 1; > create tabl

Re: [SQL] [GENERAL] Any documatation about porting from Oracle to PostgreSQL

2006-10-17 Thread A. Kretschmer
am Tue, dem 17.10.2006, um 10:44:52 +0200 mailte Thomas Kellerer folgendes: > On 17.10.2006 10:36 Andreas Kretschmer wrote: > > > >http://techdocs.postgresql.org/#convertfrom > > > > I just noticed that the link "Porting from Oracle PL/SQL" still points > to the 7.4 manuals. Shouldn't that be up

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Gregory S. Williamson
A crude approach would be to add a column to the original table; then update that based on the rand() call: update foo set i_am_a_60 = 1 where (rand() <= 0.60); create table foo_60 as select * from foo where i_am_a_60 = 1; create table foo_40 as select * from foo where i_am_a_60 <> 1; The CASE c

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread A. Kretschmer
am Tue, dem 17.10.2006, um 1:53:35 -0700 mailte Gregory S. Williamson folgendes: > Perhaps something like: > > CREATE TABLE foo2 AS SELECT * FROM foo WHERE (rand() <= 0.60); Then we have 2 tables: one with 100% data and one with around 60% ;-) If the table contains a primary key you can delete

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Achilleas Mantzios
Στις Τρίτη 17 Οκτώβριος 2006 11:34, ο/η Andreas Kretschmer έγραψε: > Felix Zhang <[EMAIL PROTECTED]> schrieb: > > Hi, > > > > I want to split a table to 2 small tables. The 1st one contains 60% > > records which are randomly selected from the source table. > > How to do it? > > Why do you want to d

Re: [SQL] [NOVICE] [GENERAL] How to split a table?

2006-10-17 Thread Felix Zhang
to do some statistics analysis. 2006/10/17, Andreas Kretschmer <[EMAIL PROTECTED]>: Felix Zhang <[EMAIL PROTECTED]> schrieb: > Hi,>> I want to split a table to 2 small tables. The 1st one contains 60% records> which are randomly selected from the source table.> How to do it?Why do you want to do th

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Gregory S. Williamson
Perhaps something like: CREATE TABLE foo2 AS SELECT * FROM foo WHERE (rand() <= 0.60); ? HTH, Greg Williamson DBA GlobeXplorer LLC -Original Message- From: [EMAIL PROTECTED] on behalf of Andreas Kretschmer Sent: Tue 10/17/2006 1:34 AM To: pgsql-general@postgresql.org; pgsql-sq

Re: [SQL] [GENERAL] Any documatation about porting from Oracle to PostgreSQL

2006-10-17 Thread Andreas Kretschmer
Felix Zhang <[EMAIL PROTECTED]> schrieb: > Hi all, > > I'm a newbie of PostgreSQL. I'm searching materials about porting from Oracle > to PostgreSQL. > Anyone can share with me some good documatations? http://techdocs.postgresql.org/#convertfrom Andreas -- Really, I'm not out to destroy Micr

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Andreas Kretschmer
Felix Zhang <[EMAIL PROTECTED]> schrieb: > Hi, > > I want to split a table to 2 small tables. The 1st one contains 60% records > which are randomly selected from the source table. > How to do it? Why do you want to do this? Andreas -- Really, I'm not out to destroy Microsoft. That will just

[SQL] Any documatation about porting from Oracle to PostgreSQL

2006-10-17 Thread Felix Zhang
Hi all,   I'm a newbie of PostgreSQL. I'm searching materials about porting from Oracle to PostgreSQL. Anyone can share with me some good documatations?   Thanks and regards, Felix

[SQL] How to split a table?

2006-10-17 Thread Felix Zhang
Hi,   I want to split a table to 2 small tables. The 1st one contains 60% records which are randomly selected from the source table. How to do it?   Regards, Felix