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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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:
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
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
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
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
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
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
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):..
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
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
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
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
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
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
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
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)
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
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
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
42 matches
Mail list logo