Re: [GENERAL] COMMIT after an ERROR?

2001-10-12 Thread Charles Tassell
The failed query will abort the transaction, and throw out every command that comes before or after it until your rollback.  You don't have to specifically issue a rollback unless you want to issue more commands though.  When you disconnect from the DB it will automatically roll back the transacti

Re: [GENERAL] Multiple postgresql installations on one machine.

2001-10-12 Thread Charles Tassell
I may be wrong, but I don't think it's possible to have them on the same port.  The problem is that the TCP/IP port defaults to the same as the UNIX sockets port, and UNIX sockets are local to the machine, so they are completely independent of IP addresses and can not be duplicated.  It is possibl

Re: [HACKERS] Re: [GENERAL] PHPBuilder article -- Postgres vs MySQL

2000-11-15 Thread Charles Tassell
Just a note, I've been using Postgres 7.02 and PHP 4.02 or 4.03 for about a month in a couple sites, and haven't experienced any problems with persistent connections. Problem might have been fixed in one of the point releases, or maybe I just don't have enough different db connections to trig

Re: [GENERAL] Limit on number of queries from CGI or PHP (security)

2000-10-18 Thread Charles Tassell
I noticed a lot of people gave some good advice, but one thing they forgot to mention is the AddSlashes command of php. It basically does all the necessary special-character escaping for you, so the worst thing someone can do by enterring bad data in your forms is bring up a page with bad res

Re[2]: [GENERAL] WTF is going on with PG_VERSION?

2000-09-18 Thread Charles Tassell
Maybe it was moved for PostGres v7 (I'm still using 6.5.3 because it works and I'm too lazy to upgrade. :-) but in older versions the PG_VERSION file was in the data directory (ie, /usr/local/pgsql/data/ ) Try checking what you are using for a data dir ("locate pg_database" should tell you wh

Re: [GENERAL] libperl.so

2000-08-05 Thread Charles Tassell
There is also a way to recompile a .a library into a shared library. Something like: ar x library.a ld -shared -o library.so *.o It's documented somewhere, a web search on "convert shared library" will probably turn up some detailed documentation. At 11:52 PM 8/4/00, Alex Pilosov wrote: >O

Re: [GENERAL]

2000-07-14 Thread Charles Tassell
You are probably not telling Postgres to run in the background. You should use the -S parameter. IE: postgres -S -i -D /usr/local/pgsql/data For full info on the startup options, do a man postmaster from your shell. Or take a look at the administration docs. At 01:05 PM 7/14/00, Sean Alpho

Re: [GENERAL] libpq connectivity

2000-07-08 Thread Charles Tassell
Someone mentioned that you had to include libpq, but you are also using the wrong GCC command line. the -c switch tells gcc to just build an object file, ignoring the main routine and not creating an actual executable program. You want something like this: $ gcc conn2.c -o conn2 -lpq At 01

Re: [GENERAL] Interface Question

2000-06-28 Thread Charles Tassell
All of the different interfaces have there own way of specifying the host to connect to (eg, with pgsql it's "pgsql -h hostname databasename") You also have to setup the pg_hba.conf file in your PGDATA directory (/usr/local/pgsql/data on my machine) to allow access from the remote machine. U

Re: [GENERAL] Compiling Error

2000-06-04 Thread Charles Tassell
You aren't including the crypt library, or your system doesn't have it. Try adding -lcrypt to the end of your compile command and try again. At 12:44 PM 6/4/00, Jesus Aneiros wrote: >Hi, > >Could somebody help me with this error. It appears when I try to compile >an ecpg program. It seems tha

Re: [GENERAL] Trouble-free vacuum w/concurrent writes? (was "PostgreSQL capabilities")

2000-05-31 Thread Charles Tassell
No, that's now what he said. You can backup the database while it's still being used (the pg_dmp runs in a transaction) but you still can't vacuum a database while it's in use. Vacuuming is more along the lines of a defrag, it updates the indexes and maintains stats. At 12:16 PM 5/31/00, Ed

Re: [GENERAL] createdb -- alternate locations

2000-05-25 Thread Charles Tassell
Try createdb -D $PGDATA2 testdb At 11:26 PM 5/25/00, J.R. wrote: > Hello: > >Novice, just installed PGSQL 7.0 on Redhat 6.1. > >Everything went smoothly with initial installation and db setup. >However, I've run into some problems subsequently. > >To keep it simple, here is a specific problem

Re: [GENERAL] Performance

2000-05-15 Thread Charles Tassell
Have you done a VACUUM ANALYZE on your database after recreating the index? At 04:56 PM 5/15/00, Diego Schvartzman wrote: >I have an application via PHP. For example, a SELECT query that must return >one and only one row, with a where clause with and index (I droped it and >created again) that to

Re: [GENERAL] Arrow keys not working

2000-05-12 Thread Charles Tassell
The problem is that your psql wasn't compiled with readline support, which is the library that allows you to use the arrow up/down command line history. There is a known problem (discussed last week on this list) where the configure script for Postgres won't detect the readline library under

Re: [GENERAL] Querying the field types of a table

2000-05-10 Thread Charles Tassell
There has been discussion on this topic before, so if you check the archives you will find more detail. Generally, the best way to find what you are looking for is to start psql with the -E option (echo queries sent to the backend) and then issue a \dt or \d tablename command to see the query

Re: [GENERAL] too many clients - Error message

2000-04-22 Thread Charles Tassell
The maximum number of backends that the PostGres postmaster will start is 32. If you want more, you have to specify the maximum on the command line with the -N option. IE, you can start postgres like this to allow internet connections, have it fork into the background, and allow 100 simultaneo

Re: [GENERAL] well, shoot. Error loading Pg.so

2000-04-19 Thread Charles Tassell
Well, a couple of suggestions: Restore the /usr/lib/perl5/site_perl directory from a working backup. Try doing a ./configure --with-perl in the src directory, then go into interfaces/Perl5 and type make;make install. Maybe the currently installed src dir wasn't correct. Might also want to ch

Re: [GENERAL] PHP-Postgres link

2000-04-09 Thread Charles Tassell
Try replacing $connection = pg_connect("", "", "", "users"); with $connection = pg_connect("dbname=users") or you might want to try $connection = pg_connect("dbname=users user=nobody") At 11:53 AM 4/9/00, Ramses v. Pinxteren wrote: >Hi, > >I am running PHP under APache with a link to a postgr

Re: [GENERAL] A Haunted Database

2000-04-09 Thread Charles Tassell
Vacuuming is sort of necessary at the moment, because if you don't vacuum, postgres won't use your indexes. :( This is supposedly going to be fixed in the 7.x series (7.5 I think I heard) but I've never heard of a vacuum corrupting a normally working database in the 4 or 5 months I've been re

Re: [GENERAL] Permission denied while importing data from a file?

2000-04-09 Thread Charles Tassell
Try moving the file into /tmp and seeing if that works. Sometimes you run into problems with having permissiosn on the file, but not all of the directories before it. You must have execute permissions on all parent directories in order to access a file in one of those dirs. The file will o

Re: [GENERAL] Selecting field names?

2000-04-09 Thread Charles Tassell
Yes, if you start psql with the -E switch (ie, psql -E -h dbserver database) then do a \d tablename it will show you the SQL query that's used to display the table definition. You can then use this to do your selects. Here is what I get when I do the above: QUERY: SELECT a.attnum, a.attname,

[GENERAL] SQL Special Characters

2000-04-05 Thread Charles Tassell
Can anyone point me to a list of the special characters for SQL strings? Ie, when I do a WHERE textstring = '12%' the % is a special character, and has to be escaped with a backslash. I'm looking for a list of all such characters. The ones I know of are ', \, and %, but I'm sure that th

Re: [GENERAL] Libpq problems

2000-03-29 Thread Charles Tassell
You got the include directories right, but you didn't tell it to link in the library by adding -lpq Try this: cc -s -I/usr/local/pgsql/include -L/usr/local/pgsql/lib program.c -lm -lnsl -lpq -o program.exe At 03:38 PM 3/29/00, Teruel Tony wrote: >Hi, > >I'm interacting with postgeSQL using C

Re: [GENERAL] DB replication

2000-03-24 Thread Charles Tassell
I'd recommend changing the structure of your tables, adding a record_added field, and then do a SELECT * FROM table WHERE record_added > CURRENT_TIMESTAMP - '15min' ::datetime and having a PERL program pipe the results of the select into the other database using DBI with two connections. BTW:

Re: [GENERAL] Regular expressions syntax: is \ the escape character ?

2000-03-03 Thread Charles Tassell
You have to use two backslashes, as the preprocessor will take the first one out (I may be wrong about this, but I remember reading something similar a few months ago on this list.) Also, remember that you have to send two slashes to PostGres, which may mean that you need to use 4 slashes in

Re: [GENERAL] Illegal use of aggregates or non-group column in target list

2000-03-03 Thread Charles Tassell
Try : select target, avg(reaction_time) from data_table group by target; Haven't tested it, but it should be close to what you're looking for. At 02:14 PM 3/3/00, G. Anthony Reina wrote: >I'd like to return an average for one item in my database grouped by >another item. For example, > >The tab

Re: [GENERAL] System requirements

2000-01-24 Thread Charles Tassell
The disks you use also play a big part in the performance you get. If you are going to have multiple simultaneous connections accessed the server, I'd go with a good SCSI disk array. Maybe even RAID if it's going to be under a high load. At 07:49 PM 1/24/00, Peter Eisentraut wrote: >This dep

Re: [GENERAL] Error connecting database

2000-01-16 Thread Charles Tassell
You might want to check that you have run initdb. Log in as user postgres and type: /usr/local/pgsql/bin/initdb Then check to make sure that postmaster is actually running, as someone else suggested. At 11:21 PM 1/15/00, C.D. Gan wrote: >I'm just trying to run PGSQL and running the test fo

Re: [GENERAL] Future of PostgreSQL

1999-12-26 Thread Charles Tassell
At 10:27 PM 12/25/99, Bruce Momjian wrote: >[snip] > > Plug-in Oracle 7 compatibility. > >I believe we are adding Oracle compatibility as possible. We are >working on write-ahead log, long tuples, foreign keys, and outer joins. >Anything else? Replication would be nice, or some other form of clu

Re: [GENERAL] Postgres install problem

1999-12-18 Thread Charles Tassell
I think your missing the glibc crypt library, look for libcrypt.so.* in your /lib dir. If it's not there, you'll have to grab it from a Linux site like ftp://sunsite.unc.edu/pub/Linux or from Caldera's website. If you do have the file, try adding -lcrypt to the LIBS line of Makefile.global in

Re: [GENERAL] Performance

1999-10-29 Thread Charles Tassell
Try turning off DBI's autocommit , that way it will cache all the inserts until it's sure there are no errors, then just do the one write to the database. You do this by changing your DBI connect command from: $pg_con=DBI->connect("DBI:Pg:." to $pg_con=DBI->connect("DBI:Pg(AutoCommit=>0):..

Re: [GENERAL] current_timestamp and default now()

1999-10-26 Thread Charles Tassell
I believe it works if you put now() in single quotes. EG: create table test ( proposetime datetime not null default 'now()', ) At 10:07 PM 10/25/99, Lincoln Yeoh wrote: >At 01:05 PM 25-10-1999 PDT, amy cheng wrote: > >hi, there, > > > >I'm using: > > > >create table test ( > >propos

Re: [GENERAL] Re: What's WAL

1999-10-22 Thread Charles Tassell
That's why you don't hear anything about them anymore, they are stuck in the past... :) At 09:20 PM 10/22/99, The Hermit Hacker wrote: >On Fri, 22 Oct 1999, Christian Rudow wrote: > > > So - get down from envying the "Illuminati" - build up a working > > linux configuration - step by step - slow

Re: [GENERAL] Postgres INSERTs much slower than MySQL?

1999-10-19 Thread Charles Tassell
Try turning off Autocommit: MySQL doesn't support transactions, so that might be what's causing the speed boost. Just change the connect line from: $pg_con=DBI->connect("DBI:Pg: to $pg_con=DBI->connect("DBI:Pg(AutoCommit=>0): and add $pg_con->commit before you disconnect. I may have

Re: [GENERAL] Connect PostgreSQL 6.0 Server with php4b

1999-10-10 Thread Charles Tassell
Your problem is probably in the /usr/local/pgsql/data/pg_hba.conf file. That file lists what machines are allowed to connect to your Postgres server and what sort of authentication they have to provide. If the web server and the Postgres server are on the same machine, you should have these two l

Re: [GENERAL] copying from one table to another

1999-10-05 Thread Charles Tassell
Try something like: INSERT INTO selection (fieldlist) SELECT fieldlist from temp_section; SELECT INTO won't work, as it requires you to be creating the destination table (well, you could drop temp_section first, but that could be annoying.) At 11:51 PM 10/5/99, Omega Weapon wrote: >I have two i

Re: [GENERAL] data type "serial"

1999-09-22 Thread Charles Tassell
If you have this table: create table testing ( id serial, datatext, md int ); You would use: insert into testing (data, md) values ('my_data', 12); insert into testing (data, md) values ('more data', 15); The key part is that you don't specify the serial f

Re: [GENERAL] how to emulate a simple case of a view on unions

1999-09-22 Thread Charles Tassell
You could try combining it into one query spanning the four tables: select tab1.field, tab2.field, tab3.file, tab4.field from tab1,tab2,tab3,tab4 WHERE clause..; At 10:59 PM 9/21/99, Martin Weinberg wrote: > >I have four tables with identical fields and I would like >to automate the same query o

Re: [GENERAL] User not in pg_shadow

1999-08-15 Thread Charles Tassell
As the postgres user run the program "createuser" It will ask fro a username (dckinder) and some other things, including whether the user can create a database. You can do the same thing by connecting to template1 with psql and using the CREATE USER command. (do \h CREATE USER from within psql)

Re: [GENERAL] Autoincremental

1999-08-15 Thread Charles Tassell
Yes, it's called "serial" IE: create table my table ( ndx serial, nametext ); "serial" is just a shortcut that creates a "sequence" (a type that is basically a counter) an sets the ndx field to be an int default nextval('sequence_name') Read the FAQ for a better explan

Re: [GENERAL] libpq.so open failed

1999-08-04 Thread Charles Tassell
I've never used Solaris, but I know you get a similar error in Linux if you don't have the dir libpq.so is in the /etc/ld.so.conf file. If you have an /etc/ld.so.conf file, add the line: /usr/local/pqsql/lib to it and run ldconfig. Hope it's that simple. :) At 05:04 PM 8/4/99, Ximo Domenech w

[GENERAL] int2/int4 Failure with 6.5.1 and SlackWare 4.0

1999-07-28 Thread Charles Tassell
Hi there, When running the regression tests for Postgres 6.5.1 on my SlackWare 4.0 box, I received an error on the int2 and int4 types. Here's what was in the regress.out file: text .. ok strings .. ok int2 .. failed int4 .. failed int8 .. ok oid .. ok float4 .. ok float8 .. ok Here is the