Re: [SQL] sqlplus reporting equivalent in postgres?

2010-12-11 Thread Gary Chambers
psql - not as advanced, doesn't have all the features SQL*Plus has. On the other hand, it is at least capable of command history and readline support. Yes, but rlwrap will eliminate that limitation. -- Gary Chambers -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To

Re: [SQL] Duplicates Processing

2010-10-12 Thread Gary Chambers
ground, up and would like to ensure that I get it right. Thanks for any advice that you (or anyone) can offer. -- Gary Chambers -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Duplicates Processing

2010-10-08 Thread Gary Chambers
;s manager. No? Thanks again for your help. -- Gary Chambers -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Duplicates Processing

2010-10-08 Thread Gary Chambers
uggesting a table like: part_number INTEGER is_replacement_for INTEGER references part_number value INTEGER wattage FLOAT8 ... -- Gary Chambers -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your s

Re: [SQL] Duplicates Processing

2010-10-08 Thread Gary Chambers
table contains only the part number (the "new" one, so-to-speak), a foreign key reference to the original parts table, and some location data (which is also in the original parts table). Is there any advice you can offer in light of what I have just described? I apologize for the over

[SQL] Duplicates Processing

2010-10-08 Thread Gary Chambers
problem. Thank you very much in advance. -- Gary Chambers -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] user function and bind

2010-05-19 Thread Gary Chambers
AND y=$2 AND z=$3'; $stmt = pg_query_params($dbh, $query, array($x, $y, $z)); -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Inserting Multiple Random Rows

2010-04-28 Thread Gary Chambers
E plpgsql STABLE; I'd like to thank Justin Graf for his time, effort, and assistance with this problem. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Inserting Multiple Random Rows

2010-04-28 Thread Gary Chambers
#x27;ll post the solution upon discovering it. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Inserting Multiple Random Rows

2010-04-28 Thread Gary Chambers
btuseness being lifted, and my grasp and command of SQL to be complete and infinite. None of which appears will ever happen... -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscript

[SQL] Inserting Multiple Random Rows

2010-04-28 Thread Gary Chambers
(SELECT userid FROM useraddrs) AND cid=(SELECT cid FROM cities ORDER BY RANDOM() LIMIT 1); I am able to achieve most of what I am trying to accomplish, but once the random number is selected, it doesn't change. What am I missing? Thank you in advance. -- Gary Chambers /* Nothi

Re: [SQL] Join Advice and Assistance

2010-02-22 Thread Gary Chambers
n. I'll be retrieving the results of the query through PHP, so cleanup in the query may even be a performance degradation. > Hope this helps, You and Rob Sargent have helped a great deal. Thanks to both of you. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via

Re: [SQL] Join Advice and Assistance

2010-02-22 Thread Gary Chambers
m.userid > left join user_emailaddrs a on m.userid = a.userid My question was related more toward eliminating the query returning a record for each record in the one-to-many table. I see now that I'm going to have to aggregate the e-mail addresses in order to return a single row. Thanks again.

[SQL] Join Advice and Assistance

2010-02-21 Thread Gary Chambers
ze where necessary. Thank you very much in advance. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Proper case function

2009-12-31 Thread Gary Chambers
defined using the contrib module > citext which makes searching very nice. Why doesn't the initcap function work as you require? -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription:

Re: [SQL] 8.4.1 distinct query WITHOUT order by

2009-12-21 Thread Gary Chambers
ning 8000 rows) and creating a view of the same name? Assuming it's possible, would the efficiency of a rule to rewrite the query be an acceptable alternative? Thanks in advance for any insight and suggestions! -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgs

[SQL] 8.4.1 distinct query WITHOUT order by

2009-12-21 Thread Gary Chambers
? What are the ramifications of renaming the table (containing 8000 rows) and creating a view of the same name? Assuming it's possible, would the efficiency of a rule to rewrite the query be an acceptable alternative? Thanks in advance for any insight and suggestions! -- Gary Chambers /* No

[SQL] Assigning Values to Composite Types

2009-10-22 Thread Gary Chambers
RETURN NEXT vsop87_data; END; $solve$ LANGUAGE plpgsql STRICT IMMUTABLE; Is there a means of filling something.something.something with a value so I can get all the values into a single row? Thanks very much in advance. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-s

Re: [SQL] Efficiency in Multiple Queries of Same Table in a PL/PgSQL Function

2009-10-19 Thread Gary Chambers
valid. I could probably rewrite it using arrays and may, in fact, do so to eliminate the two added queries. Thank you for your input. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your su

[SQL] Efficiency in Multiple Queries of Same Table in a PL/PgSQL Function

2009-10-16 Thread Gary Chambers
; END; $poly_example$ LANGUAGE plpgsql STRICT IMMUTABLE; -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Function Anomaly?

2009-10-07 Thread Gary Chambers
| ownerid | ownername | hostname | entrytime | is_private | is_active | notetext -+-+---+--+---++---+-- (0 rows) Thanks very much in advance for any insight you can provide. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-

Re: [SQL] MAY I HAVE YOUR ASSISTANCE

2008-09-01 Thread Gary Chambers
ve been more specific in my request for comments since I was only thinking about PostgreSQL-specific issues related to what I presented to the initial requestor. Thanks for your reply! -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing list (pgsql-sql@postgr

Re: [SQL] MAY I HAVE YOUR ASSISTANCE

2008-09-01 Thread Gary Chambers
rd, GEN_SALT('md5')); RETURN NEW; END; $encryptpw$ CREATE TRIGGER trg_encryptpw BEFORE INSERT OR UPDATE ON assignees FOR EACH ROW EXECUTE PROCEDURE encryptpw(); Comments, suggestions, criticisms? -- Gary Chambers /* Nothing fancy and nothing Microsoft! */ -- Sent via pgsql-sql mailing lis

Re: [SQL] Query Assistance

2007-12-12 Thread Gary Chambers
ch as I can to the power company. Thanks for taking the time to reply! -- Gary Chambers // Nothing fancy and nothing Microsoft! ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Query Assistance

2007-12-12 Thread Gary Chambers
ay of handling this? I am open to schema change suggestions. Thanks very much! -- Gary Chambers // Nothing fancy and nothing Microsoft! ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] Encrypted column

2007-06-04 Thread Gary Chambers
I need to store users and passwords on a table and I want to store it encrypted, but I don't found documentation about it, how can I create a Take a look at the pgcrypto user-contributed module. -- Gary Chambers // Nothing fancy and nothing Microsoft! ---(e

Re: [SQL] system tables inquiry & db Link inquir

2007-02-28 Thread Gary Chambers
I want to find all the sequences. What is the system tables that have the information about all the sequences? psql -E -U \ds Capture the query that psql sends to the server. Can't help with the dblink -- sorry. -- Gary Chambers // Nothing fancy and nothing Micr