Re: [GENERAL] Error while importing CSV file

2012-02-07 Thread Alban Hertroys
On 7 February 2012 06:43, Lockas  wrote:
> OK .. my offending line number is 4533
> How can i remove it while copying ?

You can remove it before copying or after, but not while.

-- 
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] problems sending email to list

2012-02-07 Thread mgould
<<< text/html; charset="utf-8": Unrecognized >>>
<>

Re: [GENERAL] problems sending email to list

2012-02-07 Thread Maton, Brett
Hi Michael,

  The mailing list address is  pgsql-general@postgresql.org  I believe.

Brett

On 7 February 2012 14:28,  wrote:

> First, I'm sorry I hijacked this message but I'm having problems sending
> any emails to this list and I'm also not getting anything returned.  I
> tried to sign up again but it says my email address is already subscribed.
> Can anyone from majordomo suggest any thing that could be wrong?  I am
> sending to pgsql-gene...@postgres.org.
>
> Michael Gould
> Intermodal Software Solutions, LLC
> 904-226-0978
>
>
<>

[GENERAL] How to write in Postgres

2012-02-07 Thread mgould
<<< text/html; charset="utf-8": Unrecognized >>>
<>

Re: [GENERAL] How to write in Postgres

2012-02-07 Thread Alban Hertroys
On 7 February 2012 15:03,  wrote:

> How do I convert this to PostGres. I'm getting a error
> ERROR: syntax error at or near "("
> LINE 23: set chr = substr(lfeid,idx,1);
>

Assuming you are writing this as pl/pgsql code, the way you do your
variable assignments is wrong on two accounts. Find some time to read the
chapter on pl/pgsql if possible ;)

Anyway, that line should read:
chr := substr(lfeid,idx,1);

-- 
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.


Re: [GENERAL] default database selector

2012-02-07 Thread Adrian Klaver
On Monday, February 06, 2012 10:31:51 pm Dave Potts wrote:
> I am running Ubuntu 11.04, I have Postgres 8.4 and 9.1 installed.
> 
> My default when I say psql it connects to postgres 8.4
> 
> ie I set export PGCLUSTER=9.1/main
> 
> it connects to 9.1
> 
> Q.  How can I connect to 9.1 by default without having to set PGCLUSTER?
> 
> I looked in /etc/postgresql-common, there did not seem to be anything
> obivious in there for which version to use.


http://man.flashnux.com/en/debian/6/6.0.2/man7/postgresql-common.7.html
From here it would seem there several options beside using PGCLUSTER.
You could set up a user ~/.postgresqlrc file
or
a system wide /etc/postgresql−common/user_clusters where
"
/etc/postgresql−common/user_clusters

stores the default cluster and database for users and groups as set by the 
administrators.
"
In either case I am not sure the above will help with you PHP problem.  The 
cluster option seems to be specific the pg_wrapper program and lives a layer 
above that which PHP is using to connect. The PHP issue may solved however by 
using a service file:
http://www.postgresql.org/docs/9.0/interactive/libpq-pgservice.html

Basically a way to group connection parameters for a  particular server.  

The other way would be to specify the connection parameters directly in the 
connection string and not using the --cluster option.  In your case that would 
probably be just a matter of naming different ports for the 8.4 and 9.1 
databases 
respectively. 

> 
> Dave.

-- 
Adrian Klaver
adrian.kla...@gmail.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Error while importing CSV file

2012-02-07 Thread Adrian Klaver
On Monday, February 06, 2012 9:43:35 pm Lockas wrote:
> OK .. my offending line number is 4533
> How can i remove it while copying ?

As others have said if it is just the one line remove it manually and then do 
the COPY.

If there are many lines and if you will dealing with this on a recurring basis 
I 
would suggest taking a look at pgloader:

http://pgloader.projects.postgresql.org/

There is a bit of learning curve, but it will do the clean up for you.

-- 
Adrian Klaver
adrian.kla...@gmail.com

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] How to write in Postgres

2012-02-07 Thread Merlin Moncure
On Tue, Feb 7, 2012 at 8:03 AM,  wrote:
>
>  I have a SQL statement that I'm trying to convert from a SQL Anywhere 
> function, but I'm getting a error.  Can't seem to figure out why.  Is the 
> substring usage incorrect and if it is how do I accomplish this.  I'm trying 
> to step through the item 1 character at a time so that I can reformat the 
> input correctly.
>
> This is inside a WHILE loop (While idx < 11 loop. idx has been initialized to 
> 1 and is declared as a integer.
> set chr = substr(lfeid,idx,1);

in plpgsql:

WHILE idx < 11
LOOP
  chr := substr(lfeid,idx,1);
END LOOP;

http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html

I could probably help you work it into a single query if you provided
some more detail.

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Postgres Table level statement logging

2012-02-07 Thread Madhu S R
Hi,

I need to log the statements executed for a list of tables. It will be Data 
Modification statements like INSERT/UPDATE/DELETE on any of these tables. 
Please let me know if this is possible in postgres logging.

Regards,
Madhu


Re: [GENERAL] Don't Thread On Me (PostgreSQL related)

2012-02-07 Thread Achilleas Mantzios
On Τρι 07 Φεβ 2012 07:05:00 John R Pierce wrote:
> On 02/03/12 5:53 PM, Rodrigo E. De León Plicet wrote:
> > Author's followup:
> > 
> > http://drcoddwasright.blogspot.com/2012/02/damn-you-damocles.html
> 
> his links hardly seem related to his proclamations.

From the guy's blog:

"Shameless Plug
 I know a little something about SQL, DB2 (preferably LUW, z/OS if the money's 
right), Oracle, SQL Server, Postgres, and database design in general. "

z/OS? It is apparent that this person has a mainframe background, and the rest
of the keywords he mentions are just buzzwords he has little idea about...

Believe me, I was an ex- IBM MVS sysprog (+10 yrs ago) and struggled to get 
back into the BSD/linux world. One cannot think unix/mainframe at the same 
time, the concepts are so different, they are nearly mutually exclusive.

-- 
Achilleas Mantzios
IT DEPT

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] SOUNDEX call

2012-02-07 Thread 84.le0n
Hi all,
I'm developing Joomla's PostgreSQL database driver that (I hope) will
be included soon in this CMS [1] [2].
During my developing time I've found a big problem, not yet resolved,
about SOUNDEX function, adopted for recent added code.
I know that SOUNDEX is present inside contrib module, but to be
installed is required database's admin privilege to be run and,
usually during a CMS installation on a remote shared server, this
privilege is not given.
Now the problem is, how can I enable SOUNDEX inside database ? Is
there a way to use it without running contrib files ?
Can I hope on SOUNDEX inclusion inside core for next release, as is
for other major databases ?

Thank you for your job!

[1] https://github.com/gpongelli/joomla-platform/tree/postgresql
[2] https://github.com/gpongelli/joomla-cms/tree/postgresql

ps
I'm not a user of this mailing list, please add me to Cc.

Eng. Gabriele Pongelli

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Save and load jpg in a PostgreSQL database

2012-02-07 Thread bonave
C# Insert image 

http://net-informations.com/csprj/dataset/cs-insert-image.htm

C# retrieve image

http://net-informations.com/csprj/dataset/cs-retrieve-image.htm

bn.


--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/Save-and-load-jpg-in-a-PostgreSQL-database-tp3249969p5460759.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgres Table level statement logging

2012-02-07 Thread Vibhor Kumar

On Feb 7, 2012, at 5:42 AM, Madhu S R wrote:

> I need to log the statements executed for a list of tables. It will be Data 
> Modification statements like INSERT/UPDATE/DELETE on any of these tables. 
> Please let me know if this is possible in postgres logging.

Yes, this possible. You can set log_statement parameter.
http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-STATEMENT


Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Blog: http://vibhork.blogspot.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgres Table level statement logging

2012-02-07 Thread Andreas Kretschmer
Madhu S R  wrote:

> Hi,
> 
> I need to log the statements executed for a list of tables. It will be Data
> Modification statements like INSERT/UPDATE/DELETE on any of these tables.
> Please let me know if this is possible in postgres logging.

http://andreas.scherbaum.la/blog/archives/100-Log-Table-Changes-in-PostgreSQL-with-tablelog.html

Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.  (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.  N 51.05082°, E 13.56889°

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] SOUNDEX call

2012-02-07 Thread Marti Raudsepp
On Mon, Feb 6, 2012 at 23:48, 84.le0n <84.l...@gmail.com> wrote:
> Now the problem is, how can I enable SOUNDEX inside database ? Is
> there a way to use it without running contrib files ?

This is a bit ugly, but you could write the function yourself in the
PL/pgSQL procedural language, which is enabled by default in Postgres
9.0+. Of course this would be slower.

> Can I hope on SOUNDEX inclusion inside core for next release, as is
> for other major databases ?

Unfortunately the chances are pretty slim, the last CommitFest for
PostgreSQL 9.2 closed mid-January.

Regards,
Marti

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] problems connecting to php via pg_connect and PGCLUSTER

2012-02-07 Thread Chris

On 07/02/12 17:08, Dave Potts wrote:

Hi Chris
Thanks for the suggestion,  I tried a making the changes are you suggest,
I still getting an error from Postgres ie
  define("PG_OPTIONS"  , "--cluster=9.1/main");
  define("PG_DB"  , "tripe");
  define("PG_HOST", "localhost");
  define("PG_USER", "dp42");
  define("PG_PORT", "5432");
  define("TABLE",   "route_table");
$con = pg_connect("dbname='".PG_DB."' host='".PG_HOST."'
user='".PG_USER."' options='".PG_OPTIONS."'");

Error message
04:41 2012] [error] [client 127.0.0.1] PHP Warning:  pg_connect(): Unable
to connect to PostgreSQL server: FATAL:  unrecognised configuration
parameter "cluster" in /var/www/re/php/pgrouting.php on line 34, referer:
http://127.0.0.1/re/routing-final.html

The problem is with the database server it has issues with the string
--cluster=9.1/main"

The system is happy enough if I set PGCLUSTER as follows

export PGCLUSTER=9.1/main
psql -d tripe


psql knows what 'PGCLUSTER' is.

pg_connect() doesn't (unrecognised parameter "cluster"), so you can't do 
it that way.


You could try

define('PG_OPTIONS', 'PGCLUSTER=9.1/main');

If that doesn't work you'll have to do it the other way I mentioned.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] problems connecting to php via pg_connect and PGCLUSTER

2012-02-07 Thread Scott Marlowe
On Mon, Feb 6, 2012 at 4:03 PM, Dave Potts  wrote:
>
> I have two versions of postgres installed, 8.4 and 9.1 installed on the
> same machine
>
> To connect to my 9.1 database, I defined the envromental variable
>
> PGCLUSTER=9.1/main
>
> and use psql to connect via php pg_connect
> I have try saying
>
> define("PG_OPTIONS"  , "--cluster=9.1/main");
>
> and using the phrase
>
>  $con = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER."
> options=".PG_OPTIONS);

Get rid of the options and just put in the port of the cluster you
want to connect to.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Hi,are there any other open source parallel query engine like pgpool?

2012-02-07 Thread Pavel Stehule
Hello

http://www.postgresql.org/about/news/1351/

Regards

Pavel Stehule

2012/2/8 sunpeng :
> Hi,Friends,
>   I would like to study parallel query, also hope to implement a parallel
> db, are there any other open source parallel query engine like pgpool?
>   Thanks!
> peng

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[FIXED] Re: [GENERAL] problems connecting to php via pg_connect and PGCLUSTER

2012-02-07 Thread Dave Potts
Thanks guys its sorted.


Both your suggestions worked :-)

Scott Marlowe wrote:
> On Mon, Feb 6, 2012 at 4:03 PM, Dave Potts  wrote:
>>
>> I have two versions of postgres installed, 8.4 and 9.1 installed on the
>> same machine
>>
>> To connect to my 9.1 database, I defined the envromental variable
>>
>> PGCLUSTER=9.1/main
>>
>> and use psql to connect via php pg_connect
>> I have try saying
>>
>> define("PG_OPTIONS"  , "--cluster=9.1/main");
>>
>> and using the phrase
>>
>>  $con = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER."
>> options=".PG_OPTIONS);
>
> Get rid of the options and just put in the port of the cluster you
> want to connect to.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


-- 



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general