Re: [GENERAL] warning: pg_query(): Query failed

2005-01-05 Thread Steven Klassen
# i'm setting up a forum that's connected to postgresql 7.4.2 (via # drupal.org framework) and i'm getting some errors. here's the link, # followed by the errors verbatim: http://128.32.146.140/dmap/?q=forum We would have to see database.pgsql.inc to tell you what's wrong with it. -- Steven

Re: [GENERAL] pgsql question

2004-12-29 Thread Steven Klassen
# I need to to change an ip addres in a plpgsql function from # aaa.bbb.ccc.ddd to an sring containing aaa bbb ccc ddd upload. sklassen= select replace('216.237.145.1'::text, '.', ' ') || ' upload'; ?column? -- 216 237 145 1 upload (1 row) -- Steven Klassen

Re: [GENERAL] postgresql and javascript

2004-12-10 Thread Steven Klassen
attempting to do by having PHP or something comprable generate the javascript data sets you want when the page is rendered. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end

Re: [GENERAL] QMail

2004-10-27 Thread Steven Klassen
* Eric [EMAIL PROTECTED] [2004-10-27 14:14:25 -0400]: Is there something to interface postgreSQL with QMail to store mails in pgsql instead of using mbox or maildir? This looks informative: http://qmail-sql.digibel.be/ -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Steven Klassen
in their code without testing them. Unfortunately, that's probably not too far from reality. I've thought of it as a nice debugging feature while I'm trying to hammer out a complicated query for the first time. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Steven Klassen
* Thomas Hallgren [EMAIL PROTECTED] [2004-10-25 19:06:40 +0200]: I don't see how that makes a difference really. /me notes the timestamp on his post and vows never to post before 8am again. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL

Re: [GENERAL] list fieldnames in table? (from PHP)

2004-10-25 Thread Steven Klassen
', for example: SELECT attname FROM pg_namespace, pg_attribute, pg_type, pg_class WHERE pg_type.oid = atttypid AND pg_class.oid = attrelid AND pg_namespace.nspname = 'public' AND relnamespace = pg_namespace.oid AND relname = 'users' AND attnum = 1; -- Steven Klassen - Lead Programmer Command Prompt, Inc

Re: [GENERAL] reusing column labels in select

2004-10-19 Thread Steven Klassen
) + 1 as answer; answer 3 (1 row) -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end of broadcast)--- TIP 7: don't forget

Re: [GENERAL] Newbie table definition question

2004-10-17 Thread Steven Klassen
best bet for up-to-date information, but the Practical PostgreSQL book is still an easy read for the basics. http://www.commandprompt.com/ppbook/ -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564

Re: [GENERAL] Newbie table definition question

2004-10-17 Thread Steven Klassen
* Steven Klassen [EMAIL PROTECTED] [2004-10-17 01:52:47 -0700]: xinu= select * from items_types_view; id | item_name | type_name +---+--- 1 | Apple | fruit 2 | Orange| fruit 3 | Brocolli | fruit 4 | Lettuce | fruit (4 rows) And after I fixed

Re: [GENERAL] Newbie table definition question

2004-10-16 Thread Steven Klassen
, 'Brocolli', '1.35'); INSERT INTO grocery_items (grocery_types_id, name, price) VALUES (1, 'Lettuce', '2.55'); HTH, -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end

Re: [GENERAL] Newbie table definition question

2004-10-16 Thread Steven Klassen
* Steven Klassen [EMAIL PROTECTED] [2004-10-16 17:42:17 -0700]: INSERT INTO grocery_items (grocery_types_id, name, price) VALUES (1, 'Apple', '0.50'); INSERT INTO grocery_items (grocery_types_id, name, price) VALUES (1, 'Orange', '0.75'); INSERT INTO grocery_items (grocery_types_id, name

Re: [GENERAL] Newbie table definition question

2004-10-16 Thread Steven Klassen
. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send

Re: [GENERAL] Verifying a user.

2004-10-14 Thread Steven Klassen
boolean AS 'SELECT CASE WHEN passwd = md5($2) THEN true ELSE false END FROM pg_shadow WHERE usename = $1;' LANGUAGE sql; -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end

Re: [GENERAL] Verifying a user.

2004-10-14 Thread Steven Klassen
* Steven Klassen [EMAIL PROTECTED] [2004-10-14 10:07:39 -0700]: CREATE FUNCTION check_passwd(text,text) RETURNS boolean AS 'SELECT CASE WHEN passwd = md5($2) THEN true ELSE false END FROM pg_shadow WHERE usename = $1;' LANGUAGE sql; Strike that - go with what Michael recommended. I glanced

Re: [GENERAL] Count Issues

2004-10-14 Thread Steven Klassen
* Dev [EMAIL PROTECTED] [2004-10-14 16:54:56 -0400]: I am trying to get a total number of rows returned form a query. SELECT count(this) from table group by this Remove the 'group by' clause -- you don't need it. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http

Re: [GENERAL] connection or query affected

2004-10-12 Thread Steven Klassen
active'); -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] data dir permissions and ownership

2004-10-12 Thread Steven Klassen
* CSN [EMAIL PROTECTED] [2004-10-12 11:40:52 -0700]: chown -R postgres.nobody data chmod -R 0700 data Try postgres.postgres, otherwise that looks okay AFAICT. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services

Re: [GENERAL] How Do I Change The 'Owner' of a Database?

2004-10-12 Thread Steven Klassen
' as well. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services, (503) 667-4564 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http

Re: [GENERAL] How Do I Change The 'Owner' of a Database?

2004-10-12 Thread Steven Klassen
have anything to do with ownership, FWIW. ;) http://www.postgresql.org/docs/current/interactive/sql-alterdatabase.html http://www.postgresql.org/docs/current/interactive/runtime-config.html Best Regards, -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Steven Klassen
(dbi:Pg:dbname='samik';host='abc.org';port=5432,samik,); It seems that machine can't resolve abc.org (although I can). The format of your connect string is a little unorthodox, but it seems to work in general. What does 'dig abc.org' return on this machine? -- Steven Klassen - Lead Programmer Command

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Steven Klassen
, and port directives are space delimited. I didn't catch earlier that you said it works on the command line but not as a CGI. I'll have another look at the original post. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication Support Services

Re: [GENERAL] interfaces for python

2004-10-07 Thread Steven Klassen
* Pierre-Frédéric Caillaud [EMAIL PROTECTED] [2004-10-07 10:45:57 +0200]: I'd advise psycopg as the fastest one (by a factor of 10x on large selects). I second this recommendation. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication

Re: [GENERAL] Reading a text file into PostgreSQL

2004-10-07 Thread Steven Klassen
* Eyinagho Newton [EMAIL PROTECTED] [2004-10-07 09:41:47 -0700]: Can anyone explain how postgreSQL reads from a text file into tables already created in PostgreSQL? Where did this text file come from? What format is it in? -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http

Re: [GENERAL] PSQL undesired transaction behavior when connection is lost.

2004-10-07 Thread Steven Klassen
pay_stub.created_data =1096527603; delete from pay_stub where id in (select id from pay_stub where created_date = 1096527603 order by created_date desc); commit; DELETE FROM pay_stub WHERE created_data =1096527603; -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com

Re: [GENERAL] PSQL undesired transaction behavior when connection is lost.

2004-10-07 Thread Steven Klassen
* Steven Klassen [EMAIL PROTECTED] [2004-10-07 12:33:34 -0700]: DELETE FROM pay_stub_entry JOIN pay_stub ON (pay_stub_entry.pay_stub_id = pay_stub.id) WHERE pay_stub.created_date =1096527603; After RTFM'ing it appears you can't do actual joins with delete so we'll just have to daisy-chain

Re: [GENERAL] PSQL undesired transaction behavior when connection is lost.

2004-10-07 Thread Steven Klassen
* Tom Lane [EMAIL PROTECTED] [2004-10-07 16:33:26 -0400]: Steven Klassen [EMAIL PROTECTED] writes: * Mike Benoit [EMAIL PROTECTED] [2004-10-07 11:47:50 -0700]: I assume I'm not the first person to run in to this, however searching google didn't seem to come up with anything useful

Re: [GENERAL] Question about timezones

2004-10-07 Thread Steven Klassen
date/time conversion in my application? The time zone support seems pretty exhaustive. Check out section B-r in the document below. http://www.postgresql.org/docs/7.4/static/datetime-keywords.html HTH, -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com