I am debugging a performance problem with a
view. I have narrowed down the problem to when I adeed columns to my view.
In the examples below I have a view with 10
columns. I run an explain plan and it uses the primary key of the driver
table (enrollment table) as to be expected and execu
and didn't see
anything (of course I could have missed references).
thanks - Joe
snip of an Article from SQL archives
CREATE VIEW two_tables AS SELECT
t1.id, t1.name, t1.abbreviation, t1.juris_id FROM t1 UNION
ALL SELECT t2.id, t2.name, NULL, t2.juris_id FROM
t2;This works fine as a vie
d),
PRIMARY KEY (band_id, album_id)
)
This of course precludes the same band being listed twice in a given
album. If you do need that info, then you're really asking for "tracks".
Joe
---(end of broadcast)---
TIP 9: In versions belo
t; tables (with a textual representation of the columns). An
interesting side effect was discovering data inconsistencies in the
MySQL database since as part of the conversion I implemented foreign key
constraints under PostgreSQL (which were missing in the former).
Joe
---
or 2). Another
redundancy is the "date_trunc('day', updated) != created" which is there
to avoid selecting "changed" records when they're actually new.
However, although creating these views may simplify the subqueries it
doesn't seem there is a way to
mention that because in essence the query is used
to materialize a view, i.e., it's part of an INSERT / SELECT into a
table which is then joined back to the other tables to construct a web
page as well as an RSS feed.
Joe
---(end of broadcast)---
good idea too because schema changes would be
somewhat insulated by the layered views.
Best regards,
Joe
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
days 22:47:41.749756";"*2420"
"3 days 06:05:59.456947";"*2420"
which should average to just over nine days -
Uh ... how do you arrive at that conclusion? I haven't done the math,
but by eyeball an average of four-something days doesn't look out of
2;
t
-
2006-06-07 22:24:00
2006-06-09 22:21:00
2006-05-31 23:21:00
2006-06-04 22:47:00
2006-06-03 06:05:00
(5 rows)
test=> select avg(t - '2006-5-31 0:0'::timestamp) from x2;
avg
-
5 days 09:47:36
(1 row)
Joe
-
two locations:
that's a matter of safety. Slony does it automatically, as long as
the daemon is running. No need to control it.
But with file-based log shipping (see
http://linuxfinances.info/info/logshipping.html) one could write a Java
app to control when the updates are applied.
Aaron Bono wrote:
Are there any web based management tools for PostgreSQL (like Mysql PHP
Admin except for PostgreSQL)? I thought I saw a post sometime back
about one but don't remember the name.
Yes, that's phpPgAdmin (http://phppgadmin.com).
Joe
or;
You haven't declared numRegistros.
Joe
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
. Expression Evaluation Rules of the manual:
The order of evaluation of subexpressions is not defined. In particular,
the inputs of an operator or function are not necessarily evaluated
left-to-right or in any other fixed order.
There's more examples there too.
Joe
--
ed if
> they reference just the one single column. Ick.
I didn't realize before that you can also drop all columns, leaving a
table without *any* columns. Is that a SQL92 "feature"?
Joe
---(end of broadcast)---
TIP 4: Have
ier names, you have to use double quotes wherever you refer to
the identifier. Without the double quotes, the SQL implementor can
either use UPPERCASE (as I believe Oracle and DB2 do) or lowercase (as
PG does) when it displays those identifiers.
Joe
---(end of broadcas
ntation under the GRANT privileges section that would help
> immensely. I always have to hunt this down when I need it.
You mean something like \du at the psql prompt?
Joe
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
uisition.
I think you want to cast the field, not the constant, e.g.,
testdb=> select * from t2 where date(tm) = '2006-9-6';
tm
---
2006-09-06 00:00:01-04
2006-09-06 23:59:59.99-04
(2 rows)
Joe
HOUR:MINUTE:SECOND
>
> the question is how I drop the millisecond??
Take a look at date_trunc() under Date/Time Functions and Operators.
Joe
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
nd remember to take any numbers with a large grain of salt, YMMV, etc.
Joe
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
gt; 510/30/2006
>
> Now I need a query that will subtract atime of row 1 from row 2, row2
> from row3 and so on...
>
> Can anyone please help?
How about something like this
select x.id, x.atime, x.atime - y.atime as diff
from yourtable x, yourtable y
where x.id + 1 = y.id;
Did you look at the setting of redirect_stderr, and the various logging
settings just above it?
Joe
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
,
> 41504,
> 41505,
> 41506,
> 41507,
> 41508,
> 41509,
> 41510,
> 41511,
> 41512,
> 41513,
> 41514,
> 41515,
> 41516,
> 41517,
> 41518,
> 41519,
> 41520,
> 41521,
> 41522,
> 41523,
> 41524,
> 41525,
> 41526,
> 41527,
> 41528,
R
fore cannot
transform one expression into another? What about "x = 10 AND x < 5"?
Can't it reduce that to FALSE?
Joe
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscri
ecution" may not be
that obvious to the "naked eye" but it would be to a boolean logic
analyzer.
As to whether these query instances represent few or are typical is
arguable, and will depend on the type of application, level of knowledge
among users, and what k
hat on Windows you need to use double backslashes, i.e., 'c:\
\autodrs_appraisal_new.txt', although the regular slash may also work,
i.e., 'c:/autodrs_appraisal_new.txt'.
Joe
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
show.show_name,
> story.title, person.firtname, person.lastname, etc.
>
> What is the most elegant way to build a single query to match search
> words with multiple columns?
You may want to take a look at contrib/tsearch2.
Joe
---(end of broadcast)---
IntId FROM MyDataTable
ORDER BY id;
The id_seq is the sequence on your ID column, assuming it has one, or
you can replace the (SELECT ... FROM id_seq) by 1000.
Joe
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
gt; rules used by psql's \d commands (see Patterns), so multiple tables can
> also be selected by writing wildcard characters in the pattern."
But note that this is a new feature in 8.2. In 8.1 and earlier,
multiple -t switches will only get you the last one specified.
Joe
erpriseDB and Pervasive may have some of
what you're looking for since they have to measure themselves against
the competition.
And remember to take any numbers with a large grain of salt, YMMV, etc.
Joe
---(end of broadcast)---
TIP 1: if p
= tb2.id
Try
select tb1.* from tabel1 as tb1, table2 as tb2
where tb2.id = 2
and tb1.fk_tb2ID = tb2.id;
Joe
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL
tion condition "no_data_found"
> CONTEXT: compile of PL/pgSQL function "audio_format_func" near line
> 15
The constant is no_data. See
http://www.postgresql.org/docs/8.2/static/errcodes-appendix.html
Joe
---(end of broadcast)--
rewrite or cast the expression.
As suggested by the error, you should use a cast, e.g.,
insert into test_a values 9::bit(3);
This will result in binary '001' being inserted because you need 4 bits
to represent decimal 9.
Joe
---(end of broadcast)
using the bit
string operators, as someone pointed out a couple of days ago. In case
you haven't looked at them, please see:
http://www.postgresql.org/docs/8.2/static/functions-bitstring.html
Joe
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
licit cast, and finally it has to convert back
to text for the to_number function. The result of to_number is numeric
and you're trying to cast it to bit, which is what the ERROR was telling
you can't do.
Joe
---(end of broadcast)---
TIP 7:
expire, and that test isn't free. Therefore, you do it the same way
> any other row gets expired.
Just curious: is there a way to defeat MVCC? i.e., if you can lock the
database exclusively, there won't be any readers or writers?
Joe
---(end of broadcas
yone on
this list) will be out of a job and PHP/Perl/etc. will be relegated to
the dustbin of programming languages. [Sorry, couldn't resist :-) ]
Joe
* see http://en.wikipedia.org/wiki/Geico
---(end of broadcast)---
TIP 3: Have you checked
n as to how this will be accomplished or ensured that it is correct.
Second is how does TML handle relational manipulations such as
restriction, projection or aggregation. It appears TML is primarily for
joins.
Lastly, Dmitry, I think you'll be better off discussing this in
comp.databases.theory.
n a
real web application. Show us what TML can do for the users, bboard and
classified_ads tables
(http://philip.greenspun.com/sql/data-modeling.html), and how it can
answer the simple and complex queries in the next two chapters (or as I
said, pick a real-life example of your own) and then maybe w
all about. The
POSTGRES UCB project had a language called PostQUEL, which may have been
technically superior to SQL, but market forces (unfortunately not all
"free") pushed Postgres95 and then PostgreSQL to adopt the latter in
preference to PostQUEL. Maybe one day we'll ha
agree and converge on those choices.
>
> 1. Not users, but programmers.
> 2. Needs are produced also, as goods and capital goods.
> Karl Marks
>For example, look at yourself.
We are on diametrically opposed sides of that argument, but it's
off-to
Dmitry,
On Thu, 2007-04-26 at 11:33 +0300, Dmitry Turin wrote:
> Joe, i speak not about you, but about statistics.
Do you actually have statistics of how many people in the general
population have learned SQL? And furthermore, how many of those people
didn't already know or didn
t you seem to be having a hard time convincing those of us who've
taken even a mild interest in TML that it's really needed or is a better
solution than what exists today.
Joe
---(end of broadcast)---
TIP 1: if posting/reading through Usenet
ocal/share/postgresql/timezone.
Joe
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
did happen,
code points 1777 and nearby are not digits; they're something or other
in Arabic, apparently.
Precisely. 1777 through 1780 decimal equate to code points U+06F1
through U+06F4, which correspond to the Arabic numerals 1 through 4.
Joe
---(end of broadcast)---
TIP 6: explain analyze is your friend
hat it's application specific. The HTML/Perl script ought to
convert to Western numerals.
Joe
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
col1 = 3;
will result in:
col1 | col2 | col3
--+--+---
1 | 789 | third record
2 | 456 | second record
3 | 789 | third record
So, it is a join ... of a table with a virtual copy of itself.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To
nd above. I don't see why my query would fail in
subsequent releases.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
xample using the pyformat style:
http://www.devx.com/opensource/Article/29071/0/page/3.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
t support
prepared statements.
I assume you didn't check the PEP 249
(http://www.python.org/dev/peps/pep-0249/). The execute() and
executemany() Cursor object methods are precisely to prepare and execute
database operations.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sq
Use an underscore (_) instead of a minus (-), i.e., $bcp_fix$.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
loop, you
can check sqlca.sqlcode for 100 (NOT FOUND) or a SQLSTATE of 02000.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
ter since
it's shared with others at our hosting provider. Is there some way to
override the cluster setting, or plans to allow for database-specific
collation orders?
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresq
27;s even trickier than this simple example, because on Debian which is
using the en_US locale, the double quotes are disregarded for ordering
purposes, e.g.,
Medical
"Meet"
Message
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
a
--
Abc
123
"quoted"
(3 rows)
Those operators give me "C"-style collation in the database that is
using "en_US" collation, but what I would really prefer is the reverse.
BTW, where are those operators documented? Neither Google nor Yahoo nor
postgresql.org s
ce transaction 1 was applied to
both invoices A and B, you need to group the invoices so that you can
compare total invoiced against total paid.
Joe
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
print "USER HAS BEEN ADDED$ADDstatement";
}
Has anyone done this before? If so I could use some guidence because I can't
seem to get it working.
Joe Adams
e escape/tab key for command
completion, but on my remote web host (webpipe.net) those keys don't work.
What do I need to do to get these features working on my remote web host?
I've seen reference to .psqlrc in the psql man file, but not much else (no
syntax, etc).
Thanks in advance!
Joe
meantime I found my own work-around -- I copied local copies of psql and
libpq up to my account on the web host. Then I put my own account folder to
the front of the PATH and added a LD_LIBRARY_PATH. Now when I run 'psql' it
works just like on my own machine!
Thanks again for the response.
Joe
> Because PHP is supposed to solve web development problems. And this is
> one of them. It's very useful.
Why solve one that is already solved? PHP isn't here to reinvent the wheel -
get crontab and quit crying.
--Joe
>
> -Roberto
&g
large tables (>10M tuples).
Thanks,
Joe
> Hello,
>
> I'm working on an application where I need to design for one table to grow
> to an extremely large size. I'm already planning to partition the data
into
> multiple tables, and even possibly multiple servers, but e
;
-- then tried
create index foo_idx1 on foo using HASH (guid);
SELECT ks FROM foo WHERE guid = 'f9ee1930f4010ba34cc5ca6efd27d988eb4f921d';
The query currently takes in excess of 40 seconds. I would appreciate any
suggestions for optimizing to bring this down substantially.
Thanks in advance,
Joe Conway
hit rate. I also repeated my test with 15 million records
with similar results. Not bad at all!
I am still interested in any generic optimization tips for very large
tables.
Thanks for taking the time to reply!
Joe
Hello,
I was looking for a datatype to represent a single byte unsigned integer.
The closest thing I can find looking through the online manual is a one byte
char. Are there any side-effects of using a char datatype for this purpose?
Is there a better datatype to use?
Thanks in advance,
Joe
d populate some sort of identification table.
Thanks,
Joe
xtend PLpgSQL
using C functions like this.
Anyway, any help or advice will be much appreciated!
Thanks,
Joe
> Hi,
>
> I'm trying to create a C function that I can call from within a PLpgSQL
> trigger function which will return a list of all the values in the NEW
> record formatt
ll probably just write all of my logic into a C function and
skip PLpgSQL entirely. That's too bad because it would be far simpler (and
preferrable IMHO) to write a generic trigger function in PLpgSQL and call C
functions for only certain operations that PLpgSQL does not directly
support.
Joe
eSQL?
Hi Chris,
The (+) in Oracle is for an outer join. See
http://www.postgresql.org/devel-corner/docs/postgres/sql-select.html , in
the join-type description, left outer join. Outer joins are only available
in PostgreSQL 7.1, which is currently in the late stages of beta testing.
$HOME/bin/monthend.sh) might look like:
#!/bin/sh
psql -U postgres mydatabasename < $HOME/bin/monthend.sql
then run (see "man 5 crontab" for more on cron)
crontab -e
and add an entry like
# run at 2:15 AM on the 30th of every month
15 2 30 * * $HO
ico filename.) Please tell me some
> description how to save the file in cron and to achive
> this. I will be thankful to you.
>
Instead of "ctrl+z", press ":wq" (colon for command mode, w for write, q for
quit). This assumes that vi is your default edit
other results status" at
http://postgresql.readysetnet.com/users-lounge/docs/7.1/postgres/plpgsql-des
cription.html.
Hope this helps,
Joe
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
need to accompolish in a single query!
This should work:
select e.emp_id
from employee as e left join salesorder as s
on e.emp_id = s.emp_id
where s.emp_id is null;
-- Joe
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Type
> ---+--
> entity| character varying(3)
> loaddate | date
> loadtime | time
> btree
Just a guess, but what happens if you build i_pl_pseq(pseq, entity), i.e.
reverse the key fields? Also, has the table been vacuum analyzed?
-- Joe
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
d be fairly easy to port to a Postgres C function. The algorithm itself
comes from Donald Knuth in "The Art Of Computer Programming, vol. 3: Sorting
And Searching", Addison-Wesley (1973), pp. 391-392.
HTH,
-- Joe
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
r English
words) than soundex, and levenshtein offers an entirely different and
interesting approach. Any interest in having all three of these in the
backend?
-- Joe
---(end of broadcast)---
TIP 2: you can get off all lists at once wit
ot sure if that's soon
enough to make it into 7.2. Should it be a contrib, or in the backend?
-- Joe
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Postgres dosen't seem to support. I am confused on how
> to replicate the behavior however. We often link together many tables via
See http://www.postgresql.org/idocs/index.php?queries.html
You also might want to take a look at
http://www.postgresql.org/idocs/index.php?explici
> The "Name Alike" PL/pgSQL function has been posted on Roberto Mello's
> cookbook:
>
>
http://www.brasileiro.net/postgres/cookbook/view-one-recipe.adp?recipe_id=96
7
>
> This function requires Joe Conway's port of the Metaphone and
> Levenshtein functio
tmt in one command). If anyone has any answers, or
> workarounds pls do email me
Well, that syntax doesn't work on SQL Server either.
I think what you want is:
insert into table1(field1,field2) select field1, field2 from table2;
HTH,
-- Joe
create table mytable (
myfield serial primary key,
myotherfield integer);
Using the SERIAL data type automatically creates the sequence and default
statements for you.
-Original Message-
From: Mayuresh Kadu [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 2:36 AM
To: [EMAIL PROT
mple:
$sql = "select image from fax_info ";
$sql .= "where serial = 1";
$rs = pg_exec($conn, $sql);
$image = stripcslashes(pg_result($rs,0,0));
header("content-type: image/jpeg");
echo $image;
Hope this helps,
Joe
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly
lpgsql function that will do what you need. You might also look at
the earthdistance code in contrib if you'd rather have a C function.
HTH,
Joe
geodist.sql
Description: Binary data
---(end of broadcast)---
TIP 2: you can get off all list
orm dependent?). I do recall at least one
interpretation of rounding that calls for rounding a 5 to the even digit
(ASTM), so the rint behavior may not be strictly speaking a bug -- but
certainly having two different interpretations is.
In any case, use "select round(2.5,0)" for now.
^^^
From the error message, looks like you spelled haveChildren wrong.
HTH,
Joe
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
uture_work_date
end
from
(
select $1
+ (($2 / 5)::text || '' weeks'')
+ (($2 % 5)::text || '' days'')
as future_work_date
) as t1
' language sql;
CREATE
testslv=# select get_future_work_day('2002
elp?
The short answer is "yes, but..."; see the thread at:
http://archives.postgresql.org/pgsql-interfaces/2002-06/msg00042.php
for a recent discussion about this.
HTH,
Joe
---(end of broadcast)---
TIP 2: you can get off all lists at
reported something like 500
million records transferred without error. I use it myself, but not in
what I'd call heavy use.
If you are aware of any specific problems, please point me to them, and
I'll fix them before the next release.
Thanks,
Joe
---(end of br
lar, see:
http://archives.postgresql.org/pgsql-general/2002-07/msg00972.php
HTH,
Joe
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
as the tuples are actually
freed, I believe. After that you can adjust 'max_fsm_pages' and your
vacuum frequency to achieve an equilibrium.
Joe
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister comman
u on
a Linux server -- if so I found that fdatasync works better than (the
default) fsync for wal_sync_method.
HTH,
Joe
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
d that
>>fdatasync works better than (the default) fsync for wal_sync_method.
>
> Yes, I am. Any particular reason why fdatasync works better?
I can't remember the technical reason (although I've seen one on the
list before), but I have determined it empirically true,
and then wrap a
last_insert_id() (or whatever it is called) function around a call to
currval('my_global_seq').
HTH,
Joe
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
at1d,$lon1d,lat,long) <= $dist
and z.zip = az.zipcode
ORDER BY
LIMIT $numtoshow;
";
return $sql;
}
The "X * 60 * 1.15078" converts differences in degrees lat/long into rough
distances in miles. The zipdist function returns
themselves.
Version 7.3, in beta testing now, will do what you are looking for. If you
can, please give it a try. See:
http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html
for more info and examples.
HTH,
Joe
---(end of broadcas
nt array in pl/pgsql returned by the pl/perl
> function ?
I don't know if it is possible to construct a PostgreSQL array in pl/perl, but
I would imagine that should work. Any pl/perl users out there?
Joe
---(end of broadcast)---
TIP 1: sub
oid int, foosubid int, fooname text);
CREATE
test=# INSERT INTO foo VALUES(1,1,'Joe');
INSERT 304822 1
test=# CREATE FUNCTION getfoo(int) RETURNS foo AS '
test'# SELECT * FROM foo WHERE fooid = $1;
test'# ' LANGUAGE SQL;
CREATE
test=# select fooid(getfoo(1)), f
'"'';
ELSE
result := result || ''"'' || word || ''"'';
END IF;
END LOOP;
result := result || ''}'';
result_arr := result;
RETURN result_arr;
END
' LANGUAGE '
search_path='s1','$user','public';
SET
select current_schema();
current_schema
s1
(1 row)
-- create the table
CREATE TABLE foo (fooid int, foosubid int, fooname text);
CREATE TABLE
INSERT INTO foo VALUES(1,1,'Joe');
INSERT 794076 1
-- change
row5 | row2 | 1 | row2~row5
row9 | row5 | 2 | row2~row5~row9
(6 rows)
This allows completely dynamically generated trees.
There is also a contrib/ltree, which I believe creates a persistent structure
for the tree information, and gives you tools to manipulate it (but I have
never used it, so my discription may not be completely accurate).
HTH,
Joe
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Aasmund Midttun Godal wrote:
> It would be very usefull to have these in sql, so that it is even easier to create
>tables with encrypted passwords.
>
See contrib/pgcrypto
Joe
---(end of broadcast)---
TIP 6: Have you searched
| 1 | A1~B3
B4 | A1 | 1 | A1~B4
(8 rows)
test=# SELECT * FROM connectby('nodes','childid','parentid','B1',0,'~') AS
t(childid varchar, parentid varchar, level int, branch text);
childid | parentid | level | branch
-+--+---+--
B1 | | 0 | B1
C1 | B1 | 1 | B1~C1
D1 | C1 | 2 | B1~C1~D1
C2 | B1 | 1 | B1~C2
C5 | B1 | 1 | B1~C5
(5 rows)
HTH,
Joe
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
1 - 100 of 230 matches
Mail list logo