Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Manfred Koizar
On Tue, 24 Sep 2002 17:56:51 -0400 (EDT), Bruce Momjian <[EMAIL PROTECTED]> wrote: >Can you run a test: > > BEGIN; > SELECT CURRENT_TIMESTAMP; > wait 5 seconds > SELECT CURRENT_TIMESTAMP; > >Are the two times the same? MS SQL 7: begin transaction insert int

[SQL] Timestamp Error - 7.2

2002-09-24 Thread Keith Gray
We have moved from 7.1 to 7.2 and get the following error when extracting dates. Bad timestamp external representation ' ' eg. INSERT INTO mytable VALUES('1', '2001-09-24') Seems to accept dd/mm/ (What about ISO default?) -- Keith Gray Technical Services Manager Heart Consulting Servi

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Bruce Momjian
Roland Roberts wrote: > > "Ross" == Ross J Reedstrom <[EMAIL PROTECTED]> writes: > > Ross> Oh, interesting datapoint. Let me get this clear - on > Ross> oracle, the equivalent of: > > Well, I've never gone off to lunch in the middle, but in Oracle 7, I > had transactions which defini

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Roland Roberts
> "Ross" == Ross J Reedstrom <[EMAIL PROTECTED]> writes: Ross> Oh, interesting datapoint. Let me get this clear - on Ross> oracle, the equivalent of: Well, I've never gone off to lunch in the middle, but in Oracle 7, I had transactions which definitely took as much as a few minutes t

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > So, if I've got this straight: > [ snip ] > ... thus changing only current_timestamp. Yeah, that's more or less what I was thinking. The argument for changing current_timestamp seems to be really just spec compliance; that doesn't apply to now() or tim

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread John Hasler
Josh Berkus writes: > now() or now('transaction') returns the transaction timestamp. > now('statement') returns the statement timestamp now('immediate') returns > the timestamp at the exact time the function is called. I like that. IMHO "the exact time the function is called" is what most people

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Ross J. Reedstrom
On Tue, Sep 24, 2002 at 08:05:59AM -0700, Josh Berkus wrote: > > This looks fine to me, as a search-and-replace on current_timestamp is > easy. However, we need to do a better job of warning people about the > change than we did with interval() to "interval"(). > > Actually, can I make the

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Ross J. Reedstrom
On Tue, Sep 24, 2002 at 10:55:41AM -0400, Roland Roberts wrote: > > "Martijn" == Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > > Martijn> Well, what I would suggest is that when you wrap several > Martijn> statements into a single transaction with begin/commit, > Martijn> t

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Josh Berkus
Tom, > If we leave now() alone then there's no need to create another > non-spec-compliant syntax like 'transaction_timestamp', either. > (I really don't want to see us do that, because without parens > it would mean making a new, not-in-the-spec fully-reserved word.) So, if I've got this straig

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Roland Roberts
> "Martijn" == Martijn van Oosterhout <[EMAIL PROTECTED]> writes: Martijn> Well, what I would suggest is that when you wrap several Martijn> statements into a single transaction with begin/commit, Martijn> the whole lot could be considered a single statement Martijn> (since th

Re: [SQL] select case problem

2002-09-24 Thread Matteo Beccati
Hi, select case when division_no is null then 'no division' else 'with division' end from employee; Is the right syntax Regards -- Matteo Beccati http://www.phpadsnew.com http://phppgads.sourceforge.net ---(end of broadcast)--- TIP 1: subscribe

[SQL] select case problem

2002-09-24 Thread Joseph Syjuco
i have a table with the fields empno (not null) and division_no (null allowed) what i wanted to do is to do a select case statement such that when division_no is null itll output 'No division' if its not null itll output 'with division' unfortunately this statement doesnt work ... i need help on t

Re: [SQL] arrays (was untitled)

2002-09-24 Thread Stephan Szabo
On Tue, 24 Sep 2002, Madhavi wrote: > How do I pass an array as an aruments in a postgres function? And how do I > use it in the function?? Well, I've only got a 7.3devel machine to test, but: create function f(int[]) returns int as 'select $1[1];' language 'sql'; select f('{3,4}'); seems to

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: > On Mon, 23 Sep 2002 13:36:59 -0700, Josh Berkus <[EMAIL PROTECTED]> > wrote: >> Ideally, since we get this question a lot, that a compile-time or >> execution-time switch to change the behavior of current_timestamp >> contextually would be nice. > Ye

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Christoph Haller
> > Christoph Haller wrote: > > Hi pgsql-sql list, > > I did some testing around tables using a column > > timestamp with time zone not null default now(). > > I have noticed a valuable feature: > > As long as being inside a transaction initiated by > > begin; > > the return value of the now() fun

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Manfred Koizar
On Mon, 23 Sep 2002 23:35:13 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: >If you want to change 'current_timestamp' to >conform to a rather debatable reading of the spec, [...] Well the spec may be debatable, but could you please explain why my reading of the spec is debatable. The spec says "dur

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Manfred Koizar
On Mon, 23 Sep 2002 16:55:48 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: >Bruce Momjian <[EMAIL PROTECTED]> writes: >Here's an example: > >CREATE RULE foo AS ON INSERT TO mytable DO >( INSERT INTO log1 VALUES (... , now(), ...); > INSERT INTO log2 VALUES (... , now(), ...) ); > >I think it's impor

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Manfred Koizar
On Mon, 23 Sep 2002 13:36:59 -0700, Josh Berkus <[EMAIL PROTECTED]> wrote: >I, for one, would judge that the start time of the statement is "during the >execution"; it would only NOT be "during the execution" if it was a value >*before* the start time of the statement. It's a semantic argument.

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Manfred Koizar
On Tue, 24 Sep 2002 11:19:12 +1000, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: >Well, what I would suggest is that when you wrap several statements into a >single transaction with begin/commit, the whole lot could be considered a >single statement (since they form an atomic transaction so i