[SQL] Making dirty reads possible?

2004-12-06 Thread pgsql-sql
Hi co-fanatics. I am working on a small prove of concept, and am running into a small obstacle. (the prove of concept showing, amongs other things, that doing calculations on a database works well, and that it is possible to let it run 'jobs') Considder the following stored procedure: For rea

Re(2): [SQL] trigger output to a file

2001-03-25 Thread pgsql-sql
Thanks Cedar, Jan, and Andy. Actually the setup is something like this... There are two remote servers-remoteA and remoteB. The table of remoteA needs to be sychronized with the table of remoteB all the time (well, there could be an interval). remoteB will *publish* every changes and remoteA is *

[SQL] trigger output to a file

2001-03-22 Thread pgsql-sql
Hello Everyone, Here's my simple question. I just want to know/get the recent changes made to a table. Deeper? I wanted the Postgresql server to *publish* every changes made to a table (similar to replication, incremental transfer, etc.). What is the best way to go about it? My idea is to creat

Re(2): [SQL] Permissons on database

2001-03-14 Thread pgsql-sql
you can also do it by a shell script grantall.sh: ## start of grantall.sh ### #!/bin/ash SQL="SELECT relname FROM pg_class WHERE (relkind = 'r' OR relkind = 'S') AND relname !~ '^pg_' ORDER BY relname" OBJ=`psql -t -c "${SQL}" $1` # OBJ=`echo ${OBJ} | sed 's/EOF//g'` OBJ=`echo ${OBJ} | se

[SQL]

2001-03-14 Thread pgsql-sql
you can also do it by a shell script grantall.sh: ## start of grantall.sh ### #!/bin/ash SQL="SELECT relname FROM pg_class WHERE (relkind = 'r' OR relkind = 'S') AND relname !~ '^pg_' ORDER BY relname" OBJ=`psql -t -c "${SQL}" $1` # OBJ=`echo ${OBJ} | sed 's/EOF//g'` OBJ=`echo ${OBJ} | se

Re: [SQL] lo_import for storing Blobs

2001-03-03 Thread pgsql-sql
You can use 'DBI' from test.pl of DBD::Pg # create large object from binary file my ($ascii, $pgin); foreach $ascii (0..255) { $pgin .= chr($ascii); }; my $PGIN = '/tmp/pgin'; open(PGIN, ">$PGIN") or die "can not open $PGIN"; print PGIN $pgin; close PGIN; # begin transaction $dbh->{AutoCo

Re(2): [SQL] 7.0.3 BUG

2000-11-28 Thread pgsql-sql
Thanks to you Tom and Thomas. Now I know. - sherwin [EMAIL PROTECTED] writes: >Ah ha (or rather, ha ha ha)! I'd suggest using the RPMs posted on the >postgresql.org ftp site, which include a sample .rpmrc file which fixes >disasterous bugs in Mandrake's default compiler settings for building >RP

Re(2): Re(2): [SQL] 7.0.3 BUG

2000-11-26 Thread pgsql-sql
[EMAIL PROTECTED] writes: >"pgsql-sql" <[EMAIL PROTECTED]> writes: >> ERROR: copy: line 3910, Bad timestamp external representation >'2000-01-05 >> 00:00:60.00+08' > >> Weird because those timestamps were generated by default now(). >

Re(2): [SQL] 7.0.3 BUG

2000-11-24 Thread pgsql-sql
[EMAIL PROTECTED] writes: >"pgsql-sql" <[EMAIL PROTECTED]> writes: >> migrate=# select userid from users where userid = '[EMAIL PROTECTED]'; >>userid >> - >> [EMAIL PROTECTED] >> admin >> (2 rows) &g

[SQL] 7.0.3 BUG

2000-11-24 Thread pgsql-sql
SELECT is returning bogus data. migrate=# select version(); version --- PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc 2.95.3 (1 row) migrate=# select userid from users where userid = '[EMAIL PROTECT

[ADMIN] alter pg_shadow

2000-11-08 Thread pgsql-sql
Is it safe to rename 'postgres' to any__name? like update pg_shadow set usename = 'any__name' where usename = 'postgres'; Sherwin

Re(2): Re(2): [SQL] Large Object dump ?

2000-11-01 Thread pgsql-sql
xid loop detected, giving up My observation: The tree (directories) were created but 1131 large objects were not there. The lo_dump.index file is not readable (contains garbage). peace, sherwin [EMAIL PROTECTED] writes: > >On Wed, 1 Nov 2000, pgsql-sql

Re(2): [SQL] Large Object dump ?

2000-11-01 Thread pgsql-sql
You can try the script I made for exporting all my Pg database. Ideas were borrowed from pg_dumplo-0.0.5. Make it sure that you have "Perl5 extension for PostgreSQL - Pg.pm" installed. sherwin #!/usr/bin/perl -w # # Export large objects of all Pg database # - Sherwin T. Daganato ([EMAIL PROTEC

Re: [SQL] Large Objects

2000-10-23 Thread pgsql-sql
FROM test.pl of DBD-Pg-0.93.tar ... # test large objects # create large object from binary file my ($ascii, $pgin); foreach $ascii (0..255) { $pgin .= chr($ascii); }; my $PGIN = '/tmp/pgin'; open(PGIN, ">$PGIN") or die "can not open $PGIN"; print PGIN $pgin; close

[SQL] help on creating table

2000-10-23 Thread pgsql-sql
Hi All, I'm planning to have data in a tree structure when fetched. e.g. NODE1 + --- NODE1_1 + --- NODE1_2 |+ --- NODE1_2_1 + --- NODE1_3 Is this possible? How? I would really appreciate any help. Sherwin

Re(2): [SQL] optimize sql

2000-07-26 Thread pgsql-sql
[EMAIL PROTECTED] writes: >How does the output of the above differ from: > >SELECT name FROM office, office_application >WHERE code = office_code >AND active != 't'; > >Without knowing the table structures (which tables to active, code, >and office_code belong to?) it's hard to suggest much els

[SQL] optimize sql

2000-07-26 Thread pgsql-sql
HI! The SQL below is too slow. SELECT name FROM office, office_application WHERE code = office_code AND name NOT IN (SELECT DISTINCT name FROM office, office_application WHERE active = 't' AND code = office_code); Can anyone tell me how to optimize it? Thanks.