[SQL] Listing table definitions by only one command

2013-07-17 Thread Carla Goncalves
Hi I would like to list the definition of all user tables by only one command. Is there a way to *not* show pg_catalog tables when using "\d ." in PostgreSQL 9.1.9? Thanks.

Re: [SQL] Problem with nested left-joins and coalesce

2011-08-08 Thread Carla
Sorry, my mistake. =( Now I understood the whole problem. 2011/8/8 ai > Hi Carla! > > ** ** > > Well, maybe I too simplified my production code and now I can't see > something very simple, BUT I'm pretty sure that there isn't any original > column value

Re: [SQL] Problem with nested left-joins and coalesce

2011-08-08 Thread Carla
Hi Alex! When you wrote "COALESCE(sub6.value1, 1) as value2", you created a column "value2" that is different of the original column "sub4.value2". Try running "SELECT sub3.key3, sub4.value2, value2 FROM ..." and you'll get the result: key1;key3;value2;value2 1;1;null;1 It happens because the firs

Re: [SQL] LTREE extension and "order by"

2011-07-21 Thread Carla
> ERROR: cannot cast type ltree to text > LINE 1: ... article_id = 2 order by string_to_array(path::text,'.'):... > > Ivan > > On 21 July 2011 17:25, Carla wrote: > > Try it: > > select * from comments where article_id = 2 order by > > string_to_array(pat

Re: [SQL] LTREE extension and "order by"

2011-07-21 Thread Carla
Try it: select * from comments where article_id = 2 order by string_to_array(path::text,'.')::integer[]; 2011/7/21 Ivan Polak > Hi, thank you for your answer, please can You send me complete select > command how to convert ltree column to integer[] and use it to order > by. > > thanks > > Ivan >

Re: [SQL] Getting top 2 by Category

2011-01-19 Thread Carla
2011/1/11 Peter Steinheuser > Well, if yoi have PG 8.4 and above - > > select categoryid, magazineid from ( > select row_number() over (partition by categoryid order by > categoryid,magazineid asc) as row_number, > categoryid, magazineid from magazinecategory) foo > where row_number < 3; > cat

Re: [SQL] DELETE WHERE EXISTS unexpected results

2010-12-01 Thread Carla
tst_owner_tbl.name/> WHERE TYPE='BLAND' AND PLACE='HOME' AND SP.TST_OWNER_TBL.NAME <http://sp.tst_owner_tbl.name/>= SP.TST_USER_TBL.NAME <http://sp.tst_user_tbl.name/>) Or: DELETE FROM SP.TST_USER_TBL <http://sp.tst_user_tbl.name/> WHERE PLACE = 'HOME' AND NA

Re: [SQL] subselect and left join not working?

2010-11-30 Thread Carla
null* order by zonas.zona_id; When you do a left join and a left table value does not match any value of the right table, the left table's column will have a value and all of the right table' columns will have NULL (inclusive per_id). Carla O. 2010/11/30 Jorge Arenas > Tom, >

Re: [SQL] insert from a select

2010-11-25 Thread Carla
cl.pkid in (14507,14508) 2010/11/25 Carla > Try to explicit the column names. Something like: > > insert into tempclass (pkid, depart, sessionid, instrid) > > Select cl.pkid, cl.depart, cl.sessionid, cl.instrid, > cl.classseq,(select facility from esloc where esloc.pkid = c

Re: [SQL] insert from a select

2010-11-25 Thread Carla
Try to explicit the column names. Something like: insert into tempclass (pkid, depart, sessionid, instrid) Select cl.pkid, cl.depart, cl.sessionid, cl.instrid, cl.classseq,(select facility from esloc where esloc.pkid = cl.locationid) as facility, cl.schedule from esclass cl where cl.pkid in (14507

Re: [SQL] Executing dynamic queries (EXECUTE)

2004-02-03 Thread Carla Mello
Hello Tomasz, I´m going to study the FOR-IN-EXECUTE statement and to try again. Thanks, Carla Mello - Original Message - From: "Tomasz Myrta" <[EMAIL PROTECTED]> To: "Carla Mello" <[EMAIL PROTECTED]> Cc: "Lista dyskusyjna pgsql-sql" <[EMAIL

[SQL] Executing dynamic queries (EXECUTE)

2004-02-01 Thread Carla Mello
= ERROR:  parse error at or near "$1" at character 18CONTEXT:  PL/pgSQL function "f_population_check" line 11 at assignment ====== Somebody could help me? Thanks, Carla Mello.

Re: [SQL] Complex outer joins?

2003-03-27 Thread Correia, Carla
do copy mytable TO '/usr/share/postgresql/data1/skripte/Daten/mytable' using delimiters '\t' with null as 'isnull'; the file looks exactly the same as my original one. Am i missing something?? thanks! Carla This e-mail and any attachment is for authorised us

Re: [SQL] Complex outer joins?

2003-03-24 Thread Correia, Carla
Sorry if I was not that clear...but in fact the (+) is the join operator in Oracle. The statement in question is about making 3 left outer joins on 3 diferent tables. G, L and C are in fact 3 diferent tables. Carla -Ursprüngliche Nachricht- Von: Peter Childs [mailto

[SQL] Complex outer joins?

2003-03-24 Thread Correia, Carla
I use one same table for varios joins. This is a problem in Postgres. Any ideas? When I use the same table in say 3 or 4 joins in one SQL, is the only solution unions?? Adn if so, the performance will certainly suffer? thanks! Carla This e-mail and any attachment is for authorised use

[SQL] Complex outer joins?

2003-03-24 Thread Correia, Carla
or varios joins. This is a problem in Postgres. Any ideas? When I use the same table in say 3 or 4 joins in one SQL, is the only solution unions?? Adn if so, the performance will certainly suffer? thanks! Carla This e-mail and any attachment is for authorised use by the intended rec