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 w

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? -------

Re: [GENERAL] postgresql and javascript

2004-12-10 Thread Steven Klassen
bably 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 -

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,

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

2004-10-25 Thread Steven Klassen
' and your table is 'users', 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 attn

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.c

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Steven Klassen
rs will implement queries 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 Kla

Re: [GENERAL] reusing column labels in select

2004-10-19 Thread Steven Klassen
t them... xinu=> select (1 + 1) + 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)

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 |

Re: [GENERAL] Newbie table definition question

2004-10-17 Thread Steven Klassen
entation on the postgreSQL site is going to be your 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.co

Re: [GENERAL] Newbie table definition question

2004-10-16 Thread Steven Klassen
y (grocery_types_id)=(100) is not present in table "grocery_types". -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication & Support Services, (503) 667-4564 ---(end of broadcast)--- TIP

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'

Re: [GENERAL] Newbie table definition question

2004-10-16 Thread Steven Klassen
e', '0.75'); INSERT INTO grocery_items (grocery_types_id, name, price) VALUES (1, 'Brocolli', '1.35'); INSERT INTO grocery_items (grocery_types_id, name, price) VALUES (1, 'Lettuce', '2.55'); HTH, -- Steven

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 Programm

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 wh

Re: [GENERAL] Verifying a user.

2004-10-14 Thread Steven Klassen
ION 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; -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replicatio

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

2004-10-12 Thread Steven Klassen
Ls and neither of them 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.

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

2004-10-12 Thread Steven Klassen
g you can do with 'alter database' as well. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication & Support Services, (503) 667-4564 ---(end of broadcast)--- TIP

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 Replicati

Re: [GENERAL] connection or query affected

2004-10-12 Thread Steven Klassen
hema'"); - or - $dbh->query('SELECT foo FROM my_schema.bar WHERE active'); -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication & Support Services, (503) 667-4564 ---(end of broadcast)-

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Steven Klassen
he dbname, host, 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/ Postgre

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Steven Klassen
$dbh=DBI->connect("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.

Re: [GENERAL] Question about timezones

2004-10-07 Thread Steven Klassen
should > I simply do all my 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:

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 > >> sea

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

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

2004-10-07 Thread Steven Klassen
tub_entry.pay_stub_id = pay_stub.id) WHERE 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; -- Ste

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,

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.commandpromp