Re: [SQL] Blank-padding

2005-10-21 Thread Chris Travers
at the implicit rtrimming is going to cause problems in cases where you are trying to do things with fixed-length fields, which is really where one is likely to use bpchar anyway. It is not a showstopper, but I can see why some people don't like it. But can't please everyon

Re: [SQL] pg, mysql comparison with "group by" clause

2005-10-20 Thread Chris Travers
UP BY dept_name; SELECT dept_id, dept_name, count(*) FROM employee_list GROUP BY dept_name, dept_id; SELECT dept_id, MIN(dept_name), count(*) FROM employee_list GROUP BY dept_id; And yes, it is bad design in every case I can think of.// Why is this a problem? Best Wishes, Chris Tra

Re: [SQL] Problem -Postgre sql

2005-10-18 Thread Chris Travers
Correct me if I am wrong, but isn't COALESCE standard in this way? Best Wishes, Chris Travers Metatron Technology Consulting Michael Glaesemann wrote: [Please do not email me directly. Please post to the list so others may help and benefit from the discussion.] On Oct 19, 2005, at

Re: [SQL] insert only if conditions are met?

2005-09-05 Thread Chris Travers
INTO table_a SELECT firstname, lastname FROM table_b WHERE table_b IN (SELECT id FROM (SELECT id, sum(labor) as total_hours from table_c group by id) WHERE total_hours <> n); Best Wishes, Chris Travers Metatron Technology Consulting begin:vcard fn:Chris Travers n:Travers;Chris email;internet:

Re: [SQL] nullif('','') on insert

2005-08-26 Thread Chris Travers
nt to various snippets. I'd rather just alter the nullif function. SELECT NULLIF('' = '', TRUE); Does this work? You could write a wrapper function if necessary. Best Wishes, Chris Travers Metatron Technology Consulting ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] booleans and nulls

2005-08-26 Thread Chris Travers
need a couple with a true/false value. I'm not joining tables on NULLS, just filtering w/ them. Sounds like a partial index would be your best bet. Something like: CREATE index ON my_table WHERE my_bool IS NOT NULL Best Wishes, Chris Travers Metatron Technology Consulting --

Re: [SQL] How to secure PostgreSQL Data for distribute?

2005-08-17 Thread Chris Travers
is no good way to do this. If you are worried about this, the technology isn't going to save you. No technology will save you. Instead, I would highly suggest discussing the matter with an attourney and see if there is a legal remedy that might provide adequate protection. Best Wishes,

Re: [SQL] Trigger on select?

2005-08-02 Thread Chris Travers
ead. It may require some editing. Best Wishes, Chris Travers Metatron Technology Consulting ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] solved: Coalesce() in outer join between views

2005-07-24 Thread Chris Travers
Hi all; I found the problem (stupid human error ;-) ) Basically it was a broken join condition. Best Wishes, Chris Travers Metatron Technology Consulting begin:vcard fn:Chris Travers n:Travers;Chris email;internet:[EMAIL PROTECTED] x-mozilla-html:FALSE version:2.1 end:vcard

Re: [SQL] difference between all RDBMSs

2005-07-19 Thread Chris Travers
d), the trigger vs. rule systems in PostgreSQL (warning MS SQL uses something they call rules but it is something different), and features like inherited tables. Again, read the online documentation. Best Wishes, Chris Travers Metatron Technology Consulting ---(e

[SQL] Coalesce() in outer join between views

2005-07-19 Thread Chris Travers
m seems to be somehow assuming that all amount columns in day_source_pre are null. Is there something wrong in how this view is working, or is it (more likely) my SQL syntax? That I want to do is fill in a value from day_inc_source if and only if it is not found in day_source_pre with the sam

Re: [SQL] Way to stop recursion?

2004-11-29 Thread Chris Travers
P installations but the data is not generally being updated there.) In this case, I would create a view (with appropriate rules) which would automatically populate the common fields from the parent if it exists. The issue should not be one of storage but of presentation. Best Wishes, Chris T

Re: [SQL] SQL Challenge: Arbitrary Cross-tab

2004-08-18 Thread Chris Travers
_id FROM t1) group by case_id; CREATE VIEW t3 AS select case_id, min(timekeeper_id) AS tk_id FROM authorized_timekeepers WHERE tk_id NOT IN (SELECT tk_id FROM t1) AND tk_id NOT IN (SELECT tk_id FROM t2) GROUP BY case_id; Etc. Then you do a left join among the views. Hope that this helps.

Re: [SQL]

2004-01-29 Thread Chris Travers
You can also use PGexecParams() (see the libpq documentation).  It can be a little more cumbersome to use, though.   Best Wishes, Chris Travers - Original Message - From: MUKTA To: [EMAIL PROTECTED] Sent: Thursday, January 29, 2004 8:08 PM Subject: [SQL

[SQL] How to retrieve N lines of a text field.

2004-01-29 Thread Chris Travers
ing). Is there a workaround? Any other help? Or do I need to write a UDF? Best Wishes, Chris Travers ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED]

Re: [SQL] Database diagram

2004-01-22 Thread Chris Travers
There is a free Perl script which is called something like pgautodoc which creates DIA diagrams from databases. Take a look for it on Freshmeat. - Original Message - From: "Ganesan Kanavathy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 1

Re: [SQL] Is it possible in PostgreSQL?

2004-01-18 Thread Chris Travers
it on my system (cygwin), at the moment.  Perhaps someone else can help.     Failing that, you can write your own function to return each row.  I was working on a quick proof of concept but it was not working properly.   Best Wishes, Chris Travers   - Original Message - From: Bronx

Re: [SQL] Calendar Scripts - Quite a complex one

2004-01-08 Thread Chris Travers
actly what you need. Best Wishes, Chris Travers - Original Message - From: "Kumar" <[EMAIL PROTECTED]> To: "Chris Travers" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; "Peter Eisentraut" <[EMAIL PROTECTED]>; "psql" <[

Re: [SQL] Calendar Scripts - Quite a complex one

2004-01-07 Thread Chris Travers
cation. I think that the source for this would likely be one of those things that might be best LGPL'd if added to my app. Best Wishes, Chris Travers - Original Message - From: "Kumar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Peter Eisentraut" &

Re: [SQL] sort by on two columns

2004-01-02 Thread Chris Travers
Title: Message SELECT * FROM customers ORDER BY last_name, first_name Works for me. - Original Message - From: Andy Lewis To: [EMAIL PROTECTED] Sent: Saturday, January 03, 2004 8:15 AM Subject: [SQL] sort by on two columns Hi All, Is it possible to

Re: [SQL] Anti log in PostgreSQL

2003-12-27 Thread Chris Travers
=y. Hope this explains things. Best Wishes, Chris Travers ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Distributed keys

2003-12-24 Thread Chris Travers
indicating whether the employee is a manager, teacher, or sub. Best Wishes, Chris Travers - Original Message - From: "Michael Glaesemann" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 24, 2003 4:42 AM Subject: [SQL] Distributed keys Hell

Re: [SQL] INHERITS and Foreign keys

2003-12-23 Thread Chris Travers
Hi Pedro; I understand that at the moment it is more of a design limitation than a bug. I think we should vote the desired behavior as a feature request, however. Best Wishes, Chris Travers - Original Message - From: "Pedro" <[EMAIL PROTECTED]> > >> Foreign

[SQL] How to completely move a table to another schema?

2003-12-10 Thread Chris Travers
led me to discover that I needed to put in the second update query. Just figured I would check. Best Wishes, Chris Travers ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send &

[SQL] SECURITY DEFINER changes CURRENT_USER?

2003-07-19 Thread Chris Travers
t user. The CURRENT_USER then returns the name of the definer rather than the invoker of the function. So this being said-- are there any workarounds that don't allow anyone to change anyone else's password? Best Wishes, Chris Travers ---(end of broadcast

[SQL] How to determine the currently logged on username

2003-07-18 Thread Chris Travers
currently logged in user. How do I do this? Any ideas? Best Wishes, Chris Travers ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] PgSQL 7.3: /opt/pgsql/bin/postgres: Execute permission denied.

2003-01-13 Thread Chris Travers
Try running the initdb program first. Best Wishes, Chris Travers - Original Message - From: "Zengfa Gao" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 9:43 AM Subject: [SQL] PgSQL 7.3: /opt/pgsql/bin/postgres: Execute permission