[SQL] FW: trigger problem

2009-08-06 Thread Jan Verheyden
Hi, I keep looking for myself and tried as well the following code: 'perform dblink_connect('myconnect','dbname=postgres password=uzleuven'); create view remote as select * from dblink('myconnect','sel

[SQL] Problems when copy data from dump file

2009-08-06 Thread Klas Stockhem
> The data in the dump file are structured and I want to execute this > automatically (copy+paste it) in the EMS software. > I still get the syntax error even if I use the command you send me: > COPY artikkel (id, tittel, tekst) FROM stdin; 1Title oneSome > text \. Why not just load the du

[SQL] trigger problem

2009-08-06 Thread Jan Verheyden
Hi, If I try this to run in a trigger function 'perform dblink_connect('myconnect','dbname=postgres password=uzleuven'); perform dblink_exec('myconnect', 'insert into test (uid) values (' || quote_literal(NEW.pat_id) || ')'); return new; perform dblink_disconnect('myconnect');' I get the mess

Re: [SQL] Problems when copy data from dump file

2009-08-06 Thread Klas Stockhem
Klas Stockhem wrote: > Does the php engine interpret the big P like a small one? It's not PHP, but PostgreSQL itself. All names in PostgreSQL are case insensitive unless you double-quote them. PostgreSQL actually translates everything to lower-case internally. CREATE TABLE1 .

Re: [SQL] two records per row from query

2009-08-06 Thread John
On Thursday 06 August 2009 06:42:34 am Leo Mannhart wrote: > John wrote: > > mytable > > pkid > > class_date. > > sessionid > > > > select * from mytable > > 1 2009/01/01 2101 > > 2 2009/01/02 2101 > > > > I would like an SQL that would produce > > > > newtable > > pkid, > > class_date1, > > class_

Re: [SQL] two records per row from query

2009-08-06 Thread A. Kretschmer
In response to John : > Thanks - the sessionid's in fact do match. It's just that I can have more > than two (2) classes per sessionid. So mytable might look like: > select * from mytable > 1 2009/01/01 2101 > 2 2009/01/02 2101 > 3 2009/02/05 2101 > 4 2009/02/15 2101 > 5 2009/02/25 2101

Re: [SQL] two records per row from query

2009-08-06 Thread Leo Mannhart
John wrote: > mytable > pkid > class_date. > sessionid > > select * from mytable > 1 2009/01/01 2101 > 2 2009/01/02 2101 > > I would like an SQL that would produce > > newtable > pkid, > class_date1, > class_date2, > sessionid1, > sessionid2 > > Select * from newtable > > 1 2009/01/01 2009/01/

Re: [SQL] two records per row from query

2009-08-06 Thread John
On Wednesday 05 August 2009 10:21:08 pm A. Kretschmer wrote: > In response to John : > > mytable > > pkid > > class_date. > > sessionid > > > > select * from mytable > > 1 2009/01/01 2101 > > 2 2009/01/02 2101 > > > > I would like an SQL that would produce > > > > newtable > > pkid, > > class_date1

Re: [SQL] Problems when copy data from dump file

2009-08-06 Thread Richard Huxton
Klas Stockhem wrote: > The data in the dump file are structured and I want to execute this > automatically (copy+paste it) in the EMS software. > I still get the syntax error even if I use the command you send me: > COPY artikkel (id, tittel, tekst) FROM stdin; 1Title oneSome > text \. Why not j

Re: [SQL] Problems when copy data from dump file

2009-08-06 Thread Richard Huxton
Klas Stockhem wrote: > Does the php engine interpret the big P like a small one? It's not PHP, but PostgreSQL itself. All names in PostgreSQL are case insensitive unless you double-quote them. PostgreSQL actually translates everything to lower-case internally. CREATE TABLE1 ...;-- gives "