Re: [GENERAL] NULL/0

2004-09-19 Thread Tom Lane
David Garamond <[EMAIL PROTECTED]> writes: > Does anyone know what the SQL standard say (or doesn't say) about > division by zero for NULL? You mean NULL/0 ? SQL99 6.26 saith: General Rules 1) If the value of any simply contained in a is the null value, then th

[GENERAL] NULL/0

2004-09-19 Thread David Garamond
Does anyone know what the SQL standard say (or doesn't say) about division by zero for NULL? -- dave ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] import/export or moving data between databases

2004-09-19 Thread D. Stimits
Iavor Raytchev wrote: Dear Tom, We kind of read all documentation we could find, but that was the only way we could get - - export db structure into sql file - export the records we need into another sql file - import structure - turn off triggers - import the records - turn on triggers The main pr

Re: [GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Michael Fuhr
On Sun, Sep 19, 2004 at 12:31:26PM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > The leading space is confusing to_timestamp(): > > > test=> SELECT to_timestamp(' 2004 12 17', ' MM DD'); > > to_timestamp > > - > >2171-11-06 06:00:0

Re: [GENERAL] import/export or moving data between databases

2004-09-19 Thread Iavor Raytchev
Dear Tom, We kind of read all documentation we could find, but that was the only way we could get - - export db structure into sql file - export the records we need into another sql file - import structure - turn off triggers - import the records - turn on triggers The main problem is that we ex

Re: [GENERAL] import/export or moving data between databases

2004-09-19 Thread Tom Lane
"Iavor Raytchev" <[EMAIL PROTECTED]> writes: > The problem we face is - > When we start to import - the triggers are executed - which must not happen. We > found a way to turn the triggers off for the time of import and then turn them on > after the import. However we can turn the triggers o

Re: [GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > The leading space is confusing to_timestamp(): > test=> SELECT to_timestamp(' 2004 12 17', ' MM DD'); > to_timestamp > - >2171-11-06 06:00:00 I'd still say this is a bug. If to_timestamp can't match the input t

Re: [GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Soeren Gerlach
Mike, thanks for pointing me to the "Template Pattern Modifier" ,-)) I've just found it in the doc with your help and it works now perfectly. Thanks, Soeren > On Sun, Sep 19, 2004 at 04:17:52PM +0200, Soeren Gerlach wrote: > > > I've an integer column in a certain table that I need to convert

Re: [GENERAL] Rollback on Error

2004-09-19 Thread Michael Paesold
Tom Lane wrote: > "Michael Paesold" <[EMAIL PROTECTED]> writes: > > On the other hand, the scenario of a psql option (read: I have > > given up the idea of a backend implementation) to rollback only > > last statement on error is quite different. > > Sure (and we already have one for autocommit).

[GENERAL] import/export or moving data between databases

2004-09-19 Thread Iavor Raytchev
Hello, We a situation with a central database that contains the data that needs to be presented at N off-line terminals (N can be 5 000 can be 15 000). Each terminal presents unique data. The central database is used for data preparation. Then the data for each terminal is exported as separate

Re: [GENERAL] order of row processing affects updates

2004-09-19 Thread Greg Stark
[EMAIL PROTECTED] writes: > Hi all! > consider the following table > > table a (id int primary key) > and a particular instance of it: > id > > 5 > 6 > > now update a set id = id +1; > fails if the executor processes row with 5 first. Well the correct

Re: [GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Michael Fuhr
On Sun, Sep 19, 2004 at 04:17:52PM +0200, Soeren Gerlach wrote: > I've an integer column in a certain table that I need to convert into a > timestamp value to finally get a day difference to the current date. > >From the manual it looks like straight forward, but the following line > is a great mi

Re: [GENERAL] order of row processing affects updates

2004-09-19 Thread Jim J
On Sun, 19 Sep 2004 08:37:10 -0500, Paramveer.Singh wrote: > Hi all! > consider the following table > > table a (id int primary key) > and a particular instance of it: > id > > 5 > 6 > > now update a set id = id +1; > fails if the executor processes row

[GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Soeren Gerlach
Hello, I've an integer column in a certain table that I need to convert into a timestamp value to finally get a day difference to the current date. >From the manual it looks like straight forward, but the following line is a great mistery for me: SELECT to_timestamp(to_char(20041217, ' 99 9

Re: [GENERAL] order of row processing affects updates

2004-09-19 Thread Marius Andreiana
On Sun, 2004-09-19 at 08:37 -0500, [EMAIL PROTECTED] wrote: > table a (id int primary key) > and a particular instance of it: > id > > 5 > 6 > > now update a set id = id +1; > fails if the executor processes row with 5 first. > Basically what we would lik

[GENERAL] order of row processing affects updates

2004-09-19 Thread Paramveer . Singh
Hi all! consider the following table table a (id int primary key) and a particular instance of it: id 5 6 now update a set id = id +1; fails if the executor processes row with 5 first. This means that the query will succeed sometimes and fail at other ti