[SQL] A more efficient way?

2010-10-31 Thread James Cloos
l return the same results as a simple 'select p from m where s = 7', yes? Is there a way to do it with a self join which requires just a single loop? -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] large xml database

2010-10-30 Thread James Cloos
h COPY can grok. Any other language, script or compiled, would work just as well. The goal is to avoid having to slurp the whole xml structure into memory. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To mak

Re: [SQL] counting related rows

2010-10-15 Thread James Cloos
to add a column to track the number of children and update it, for each "parent" row via a trigger whenever a row is added, removed or the path column of a row is changed. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] counting related rows

2010-10-09 Thread James Cloos
nothing/of | 1 | 0 | 0 | 1 7 | 2 | nothing/of/value | 0 | 0 | 0 | 0 since rows 2 and 3 are children of row 1, row 3 is also a child of row 2, rows 6 and 7 are children of row 5 and row 7 is also a child of row 6. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] counting related rows

2010-10-08 Thread James Cloos
rows per second. I expect a single, complete select to take < 10 ms. Again, to be clear, for each row I need the count of other rows which have the same value for column o and whose name is a child path of the current row's name. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 --

[SQL] Escape sequence for UTF-8 Character Literals?

2008-01-10 Thread James Cloos
at \x only accepts 2 hex digits. Is doing the conversion client side the only way to do this? I’m on 8.2, if the answer is version-dependent. -JimC -- James Cloos <[EMAIL PROTECTED]> OpenPGP: 1024D/ED7DAEA6 ---(end of broadcast)-

Re: [SQL] where clause subqueries vs multiple rows results

2006-09-11 Thread James Cloos
[SIGH] I was getting the syntax wrong. Just using ON rathar than = fixed the mistake. Time to crash for the night (day?) it seems Thanks for the replies; if I hadn't've figured it out myself they would have pushed me in the right direction. -JimC -- James Cloos <[EM

[SQL] where clause subqueries vs multiple rows results

2006-09-10 Thread James Cloos
or each row returned, appending the results together. Can that be done in a single query, insead of 1+n queries? Thanks, -JimC -- James Cloos <[EMAIL PROTECTED]> OpenPGP: 0xED7DAEA6 ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Two tables or three?

2005-10-29 Thread James Cloos
> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes: Tom> You shouldn't contort your schema artificially in order to do that. Tom> Postgres automatically stores wide fields out-of-line ... Cool. Good to know it is even better than I thought. :) -JimC -- James H. Cloos, Jr. <[EMAIL PROTECTED]>

[SQL] Two tables or three?

2005-10-29 Thread James Cloos
I'm designing a schema for an app that requires two large blobs per row. Given that querying does not hit those, I presume it is beneficial to move the blobs out of the main table. But should each blob be in its own table, or should they go into a single, three column table? The main table does

Re: [SQL] bibliographic schema

2004-10-25 Thread James Cloos
Try googling for: bibtex sql That should provide some pointers that may help produce an effective sql schema for storing bibliographic references. -JimC -- James H. Cloos, Jr. <[EMAIL PROTECTED]> ---(end of broadcast)---