[SQL] Fw: C function for use from PLpgSQL trigger

2001-02-03 Thread Joe Conway
Hello all, I posted this (see below) Friday to the interfaces list with no response. Does anyone know if what I'm trying to do is possible, or should I just write the entire thing in a C function trigger? The latter would be unfortunate because I think it would be nice to be able to extend PLpgSQ

Re: [SQL] Bug with rules in 7.0.3?

2001-02-03 Thread Tod McQuillin
On Sat, 3 Feb 2001, Tom Lane wrote: > I get > > regression=# SELECT * FROM orders; > order_id | menu_id | price > --+-+--- > 1 | 2 |-1 > (1 row) > > which is the correct result given that rules are executed before the > original query. (Which is why you nee

Re: [SQL] PL/pgSQL: possible parsing or documentation bug?

2001-02-03 Thread Tom Lane
"Albert REINER" <[EMAIL PROTECTED]> writes: > create Function IdOfPossiblyNewAuthor(text) returns int4 as ' > declare > id int4; > begin > select id into id from author where name = $1; > raise notice ''ID found: %'', id; > if id is null then > insert into author (name) v

[SQL] Archival of Live database to Historical database

2001-02-03 Thread miss
Hello all I have been watching with some interest the "problem" of not being able to work with more than one database. My muse is aimed at creating an incremental backup for a very low usage database - say several hundred transactions per day Back in my days of DOS about v3 I used to use the >>

Re: [SQL] Suggestion for psql: --file -

2001-02-03 Thread Peter Eisentraut
Albert REINER writes: > > Suggested new wording? > > What about: Works for me. Thanks. -- Peter Eisentraut [EMAIL PROTECTED] http://yi.org/peter-e/

Re: [SQL] Bug with rules in 7.0.3?

2001-02-03 Thread Tom Lane
Tod McQuillin <[EMAIL PROTECTED]> writes: > How the heck can one insert and update generate three rows? Looks like a rule rewriter bug to me. It seems to be fixed in 7.1; I get regression=# SELECT * FROM orders; order_id | menu_id | price --+-+--- 1 | 2 |-

[SQL] Bug with rules in 7.0.3?

2001-02-03 Thread Tod McQuillin
Hi there... I've spotted something weird in 7.0.3 with rules. By now I've realised I probably need to use a trigger to do what I have in mind, but even so, there no way I can explain the behaviour I am getting with a rule. Given this SQL script: CREATE TABLE menu ( menu_id SERI

Re: [SQL] Suggestion for psql: --file -

2001-02-03 Thread Albert REINER
On Fri, Feb 02, 2001 at 04:16:05PM +0100, Peter Eisentraut wrote: > Albert REINER writes: ... > > P.S: BTW, the man page (7.0.2) of psql is not very clear: it took me > > some experimentation to find out that you have to do "\set VARIABLE" > > interactively or give "--set VARIABLE=" to set a varia

[SQL] Timestamp accuracy

2001-02-03 Thread Florian Steffen
Hi, The user manual said the Timestamp type has a microsecond accuracy, but how can I display the results of a query with microseconds ? Without formatting the output has an accuracy of 10^-2 second, and with formatting it is even worse since the formatting strings do not accept anything under t