Re: [SQL] Rule Error

2007-10-04 Thread A. Kretschmer
am Fri, dem 05.10.2007, um 7:16:06 +0800 mailte Hengky Lie folgendes: > Yes, it works now ! Wow, the problem is in the field name. Changed it to > lowercase solved the problem. Thank you to all ho give me this advice. > > But now I have another question regarding to this field, what command I ca

Re: [SQL] Rule Error

2007-10-04 Thread Hengky Lie
Yes, it works now ! Wow, the problem is in the field name. Changed it to lowercase solved the problem. Thank you to all ho give me this advice. But now I have another question regarding to this field, what command I can use in UPDATE RULE to make these 2 fields (KODEGL and NAMAREK) keep syncron b

Re: [SQL] What SQL is running against my DB?

2007-10-04 Thread Andreas Kretschmer
Tore Lukashaugen <[EMAIL PROTECTED]> schrieb: > Hello all, > > I have an application running against my postgres 8.2 database (on Windows > Vista) for which I do not have access to the source code. > > I would like to know what SQL statements are being executed by the > application. Is there a

[SQL] What SQL is running against my DB?

2007-10-04 Thread Tore Lukashaugen
Hello all, I have an application running against my postgres 8.2 database (on Windows Vista) for which I do not have access to the source code. I would like to know what SQL statements are being executed by the application. Is there a way to turn on logging in the server so that obtain this in

Re: [HACKERS] [SQL] Why does the sequence skip a number with generate_series?

2007-10-04 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Shane Ambler wrote: >>> CREATE TABLE jefftest ( id serial, num int ); >>> INSERT INTO jefftest (num) values (generate_series(1,10)); >>> INSERT INTO jefftest (num) values (generate_series(11,20)); >>> INSERT INTO jefftest (num) values (generate_series(21

Re: [HACKERS] [SQL] Why does the sequence skip a number with generate_series?

2007-10-04 Thread Alvaro Herrera
Shane Ambler wrote: > Stephan Szabo wrote: >> On Tue, 2 Oct 2007, Jeff Frost wrote: >>> I expected these numbers to be in sync, but was suprised to see that the >>> sequence skips a values after every generate series. >>> >>> CREATE TABLE jefftest ( id serial, num int ); >>> INSERT INTO jefftest (n

Re: [SQL] Why does the sequence skip a number with generate_series?

2007-10-04 Thread Shane Ambler
Stephan Szabo wrote: On Tue, 2 Oct 2007, Jeff Frost wrote: I expected these numbers to be in sync, but was suprised to see that the sequence skips a values after every generate series. CREATE TABLE jefftest ( id serial, num int ); INSERT INTO jefftest (num) values (generate_series(1,10)); INSE

Re: [SQL] Rule Error

2007-10-04 Thread A. Kretschmer
am Thu, dem 04.10.2007, um 19:22:32 +0800 mailte Hengky Lie folgendes: > CREATE RULE "rule1" AS ON INSERT TO "public"."tblmasdbt" > > DO (insert into tblmasgl (KODEGL,NAMAREK) VALUES (new.KODEGL, new.NAMAREK)); > > > > But I always get this error : > > > ERROR: column "kodegl" of relation

Re: [SQL] Rule Error

2007-10-04 Thread Bart Degryse
You have defined the fields KODEGL and NAMAREK as uppercased field names. In your rule you refer to an unquoted field KODEGL twice and twice to an unquoted field NAMAREK. Default behaviour of PostgreSQL for unquoted fieldnames is to lowercase them. As such these fields effectively don't exist in y

Re: [SQL] Rule Error

2007-10-04 Thread Richard Huxton
Hengky Lie wrote: I have 2 tables : tblmasdbt and tblmasgl. I want on every record insertion in tblmasdbt, that record also automatically insert into tblmasdbt. I need only 2 related field. You probably want triggers rather than rules, but anyway. CREATE RULE "rule1" AS ON INSERT TO "publi

[SQL] Rule Error

2007-10-04 Thread Hengky Lie
Dear Friends, I have problem with rule and tried several times to solve it but not yet success. Hope someone can help me. I have 2 tables : tblmasdbt and tblmasgl. I want on every record insertion in tblmasdbt, that record also automatically insert into tblmasdbt. I need only 2 relate