Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Peter Eisentraut
On Thu, 2009-09-24 at 20:36 -0400, Tom Lane wrote: > BTW, are port numbers still limited to 16 bits in IPv6? Port numbers are in TCP, not in IP. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-g

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Magnus Hagander
On 25 sep 2009, at 02.59, Tom Lane wrote: Sam Mason writes: +if (portnum < 1 || portnum > 65535) BTW, it strikes me that we could tighten this even more by rejecting target ports below 1024. This is guaranteed safe on all Unix systems I know of, because privileged ports can only b

Re: [GENERAL] What is the difference of foreign key?

2009-09-24 Thread Lew
sheepjxx wrote: To be precise, The difference between create table a ( foreign key (id) referenced by b(name), ); create table b( id integer referenced by b(name), ); They're just two different forms of invalid SQL. The difference between them makes no difference. -- Lew -

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Grant Maxwell
On 25/09/2009, at 12:50 PM, Selena Deckelmann wrote: On Thu, Sep 24, 2009 at 8:09 AM, Cédric Villemain wrote: Le jeudi 24 septembre 2009, Selena Deckelmann a écrit : Hi! On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery > wrote: Hi, I'm looking for a way to replicate am master database t

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Selena Deckelmann
On Thu, Sep 24, 2009 at 8:09 AM, Cédric Villemain wrote: > Le jeudi 24 septembre 2009, Selena Deckelmann a écrit : >> Hi! >> >> On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery > wrote: >> > Hi, >> > I'm looking for a way to replicate am master database to multiple (100+) >> > databases that ar

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Robert Haas
On Thu, Sep 24, 2009 at 8:59 PM, Tom Lane wrote: > Sam Mason writes: >> +             if (portnum < 1 || portnum > 65535) > > BTW, it strikes me that we could tighten this even more by rejecting > target ports below 1024.  This is guaranteed safe on all Unix systems > I know of, because privilege

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Kris Jurka
On Thu, 24 Sep 2009, Tom Lane wrote: Sam Mason writes: + if (portnum < 1 || portnum > 65535) BTW, it strikes me that we could tighten this even more by rejecting target ports below 1024. Restricting the target port seems like a bad idea. What about a firewall (or ssh tunn

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread KaiGai Kohei
Tom Lane wrote: > Sam Mason writes: >> +if (portnum < 1 || portnum > 65535) > > BTW, it strikes me that we could tighten this even more by rejecting > target ports below 1024. This is guaranteed safe on all Unix systems > I know of, because privileged ports can only be listened to by

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Tom Lane
Sam Mason writes: > + if (portnum < 1 || portnum > 65535) BTW, it strikes me that we could tighten this even more by rejecting target ports below 1024. This is guaranteed safe on all Unix systems I know of, because privileged ports can only be listened to by root-owned processes and

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Robert Haas
On Thu, Sep 24, 2009 at 8:36 PM, Tom Lane wrote: > BTW, are port numbers still limited to 16 bits in IPv6? Yes. ...Robert -- 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] [HACKERS] libpq port number handling

2009-09-24 Thread Tom Lane
Sam Mason writes: > Hum, why is PG doing an (unchecked) atoi on the user specified port > rather than leaving it up to getaddrinfo to resolve the port? It would > seem to require changing UNIXSOCK_PATH to accept a string as the "port > number", which is probably a bit much of a change. > The incl

Re: [GENERAL] Can't find SRPMs for PG 8.1.18 on RHEL4

2009-09-24 Thread Devrim GÜNDÜZ
On Thu, 2009-09-24 at 15:43 -0500, Justin Pasher wrote: > I'm having trouble finding the source RPMs for PostgreSQL 8.1.18 on > RHEL4. I've tried looking in the following places with no luck (I can > only find the regular RPMs). > > http://yum.pgsqlrpms.org/8.1/redhat/rhel-4-i386/ ...because th

Re: [GENERAL] v8.1 pgbench ERRORs

2009-09-24 Thread Eric B. Ridge
On Sep 24, 2009, at 5:15 PM, Tom Lane wrote: Yeah, you'll eventually overflow the balance fields because the deltas are always positive. More recent versions of pgbench use a positive-and-negative range for delta. Awesome, thanks! Was really worried that our new hardware was flaking out.

[GENERAL] Can't find SRPMs for PG 8.1.18 on RHEL4

2009-09-24 Thread Justin Pasher
I'm having trouble finding the source RPMs for PostgreSQL 8.1.18 on RHEL4. I've tried looking in the following places with no luck (I can only find the regular RPMs). http://yum.pgsqlrpms.org/8.1/redhat/rhel-4-i386/ http://www.postgresql.org/ftp/binary/v8.1.18/linux/srpms/redhat/rhel-4-i386/ A

Re: [GENERAL] v8.1 pgbench ERRORs

2009-09-24 Thread Tom Lane
"Eric B. Ridge" writes: > Anyone seen this before? Yeah, you'll eventually overflow the balance fields because the deltas are always positive. More recent versions of pgbench use a positive-and-negative range for delta. regards, tom lane -- Sent via pgsql-general maili

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread InterRob
I guess it IS quite overengineered indeed... What I'm trying to do is to facilitate different fieldwork methodologies for archaeological research (on project basis); there is no final agreement on data structure and semantics; however, on a meta-level all choices are rational and can be modelled...

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread Sam Mason
On Thu, Sep 24, 2009 at 10:33:37PM +0200, InterRob wrote: > I came to think of another option: putting additional columns (that is: > addittional to the default set of fields) in xml, in a column that is part > of row (=object) it belongs to. > Any body has done so before? Any body has experience w

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread InterRob
Sam, Thanks for thinking along. The thing is that a SINGLE constraint might apply to MULTIPLE fields; therefore it seems best to build a set of key/value pairs... Multiple doesComply()s won't do the job :( BY THE WAY: I came to think of another option: putting additional columns (that is: addittio

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread InterRob
Thank you, Ben. Well, I'm afraid you got the basic idea... I intend to implement a hybrid between a fixed schema and an Entity-Attribute-Value scheme. The schema will be able to cover 90% of the data needs; in other cases (specific projects) additional fields (and/or tables/relations) will be neede

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread Sam Mason
On Thu, Sep 24, 2009 at 09:23:35PM +0200, Rob Marjot wrote: > SELECT doesComply('relationname', keyValues.*) FROM (VALUES('col1', > CAST(col1 AS TEXT)), VALUES('col2', CAST(col2 AS TEXT))) AS > keyValues(the_key, the_value); > > The function "doesComply()" will then process the CONSTRAINTS table a

Re: [GENERAL] Log File Melancholy

2009-09-24 Thread Jerry LeVan
On Sep 23, 2009, at 7:46 PM, Tom Lane wrote: Jerry LeVan writes: could not lookup DNS configuration info service: (ipc/send) invalid destination port LOG: could not resolve "localhost": nodename nor servname provided, or not known LOG: disabling statistics collector for lack of working sock

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread Ben Chobot
Rob Marjot wrote: Thank you, Ben. Well, I'm afraid you got the basic idea... I intend to implement a hybrid between a fixed schema and an Entity-Attribute-Value scheme. The schema will be able to cover 90% of the data needs; in other cases (specific projects) additional fields (and/or tables/r

Re: [GENERAL] Newbie's question: How can I connect to my postgresql-server?

2009-09-24 Thread Sam Mason
On Fri, Sep 25, 2009 at 02:47:23AM +0700, Ricky Tompu Breaky wrote: > I'm sure that I used the correct password as "createuser" the > account of 'ricky'. By default; PG is set up not to use passwords in the "local" case. This is what the "ident" in the error is about. Your PG username needs to b

[GENERAL] libpq port number handling

2009-09-24 Thread Sam Mason
On Thu, Sep 24, 2009 at 07:57:55PM +0100, Sam Mason wrote: > > postg...@sussy:/root> createuser -D -p ricky > > I don't think you want to be passing "-p" here; it's saying to use > "ricky" as the port number, which fails (sounds like a bug if it doesn't > complain about this) giving a port number

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread Rob Marjot
Thank you, Ben. Well, I'm afraid you got the basic idea... I intend to implement a hybrid between a fixed schema and an Entity-Attribute-Value scheme. The schema will be able to cover 90% of the data needs; in other cases (specific projects) additional fields (and/or tables/relations) will be neede

Re: [GENERAL] Newbie's question: How can I connect to my postgresql-server?

2009-09-24 Thread Ricky Tompu Breaky
On Thu, 24 Sep 2009 19:57:55 +0100 Sam Mason wrote: > On Fri, Sep 25, 2009 at 01:47:03AM +0700, Ricky Tompu Breaky wrote: > > I am still new in PostgreSQL. Usually I use MySQL on OpenSuSE. > > Welcome over, PG is *normally* much better behaved than this and > generally gives very good error mess

Re: [GENERAL] Partitioned table question

2009-09-24 Thread Scott Marlowe
On Thu, Sep 24, 2009 at 12:02 PM, Reid Thompson wrote: > Assuming the examples on > http://www.postgresql.org/docs/8.3/static/ddl-partitioning.html > > where measurement has children as noted > >        CREATE TABLE measurement ( >            city_id         int not null, >            logdate

[GENERAL] v8.1 pgbench ERRORs

2009-09-24 Thread Eric B. Ridge
Okay, don't flame me for (still) using Postgres v8.1.10, but we were running pgbench on new hardware today, and in the middle of like 50 various runs of pgbench, we saw this: pgbench -c 20 -t 500 pgbench starting vacuum...end. Client 4 aborted in state 8: ERROR: integer out of range Client 3

Re: [GENERAL] About logging

2009-09-24 Thread Magnus Hagander
On Thu, Sep 24, 2009 at 21:06, wrote: > Is it possible to log two different information to two different file. > Bascially i need to log all the mod statement in one log csv file and all > the queries running more then 2mins in another csv log file. As i enabled > both it will be doing both in si

[GENERAL] About logging

2009-09-24 Thread arvindwill
Is it possible to log two different information to two different file. Bascially i need to log all the mod statement in one log csv file and all the queries running more then 2mins in another csv log file. As i enabled both it will be doing both in single file rt . Is there any way to split

Re: [GENERAL] Newbie's question: How can I connect to my postgresql-server?

2009-09-24 Thread Sam Mason
On Fri, Sep 25, 2009 at 01:47:03AM +0700, Ricky Tompu Breaky wrote: > I am still new in PostgreSQL. Usually I use MySQL on OpenSuSE. Welcome over, PG is *normally* much better behaved than this and generally gives very good error messages. > postg...@sussy:/root> createuser -D -p ricky I don't t

Re: [GENERAL] pgadmin is changing pgpass.conf

2009-09-24 Thread Alvaro Herrera
Howard Cole wrote: > Not in this case. There are originally two entries in pgpass.conf - > one for server localhost and one for server 127.0.0.1 - the > reasoning behind this is that when the backup runs as a scheduled > task it sometimes seems to prefer one format to the other. However, > when I

[GENERAL] Newbie's question: How can I connect to my postgresql-server?

2009-09-24 Thread Ricky Tompu Breaky
Dear my friends I am still new in PostgreSQL. Usually I use MySQL on OpenSuSE. I just have installed postgres with: "zypper install postgresql-server". The installation looked OK. As post-installation process, I've done: " sussy:~ # rcpostgresql status Checking for PostgreSQL:

Re: [GENERAL] lazy vacuum and AccessExclusiveLock

2009-09-24 Thread Alvaro Herrera
Jaromír Talíř wrote: > we are facing strange situation with exclusively locked table during > normal lazy vacuum. There is one big table (66GB) that is heavily > inserted and updated in our database. Suddenly (after backup and delete > of almost all records) we are not able to run VACUUM over this

[GENERAL] Partitioned table question

2009-09-24 Thread Reid Thompson
Assuming the examples on http://www.postgresql.org/docs/8.3/static/ddl-partitioning.html where measurement has children as noted CREATE TABLE measurement ( city_id int not null, logdate date not null, peaktempint,

Re: [GENERAL] How to have ant's task insert special chars appropriately?

2009-09-24 Thread Richard Huxton
agostonbejo wrote: > > > Hi Richard, > > thanks for the answer! Nevertheless, see below... ;) > >> Richard Huxton wrote: >> agostonbejo wrote: >>> Hi! >>> >>> What I'm trying to do is to insert some data from a sql file into a >> postgres >>> DB by calling the ant task. My problem is that I ca

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread Sam Mason
On Thu, Sep 24, 2009 at 06:28:28PM +0200, InterRob wrote: > I am trying to implement the following: > > In a database I wish to implement a GENERIC datamodel, thus on a meta-level. Sounds like you're describing an EAV design: http://en.wikipedia.org/wiki/Entity-attribute-value_model Designs l

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread Ben Chobot
InterRob wrote: Dear List, I am trying to implement the following: [snip] All suggestions are very much appreciated, regards, Rob It's not clear to me what you're asking, but I suspect the suggestion you need is the same as if you had asked how to best implement an Entity-Attribute-Val

Re: [GENERAL] Exception 0xC0000005

2009-09-24 Thread Grzegorz Jaśkiewicz
On Thu, Sep 24, 2009 at 5:34 PM, Ms swati chande wrote: > >SIGSEGV in micro$oft world. > > Thanks for your response. > How can this be resolved? > > Just like others said, upgrade to 8.4.1 first. -- GJ

Re: [GENERAL] Exception 0xC0000005

2009-09-24 Thread Ms swati chande
>SIGSEGV in micro$oft world.   Thanks for your response. How can this be resolved?   Regards Swati

Re: [GENERAL] Exception 0xC0000005

2009-09-24 Thread Grzegorz Jaśkiewicz
On Thu, Sep 24, 2009 at 5:22 PM, Ms swati chande wrote: > > What is exception 0xC005? > > SIGSEGV in micro$oft world. -- GJ

Re: [GENERAL] Exception 0xC0000005

2009-09-24 Thread mmoncure
On Thu, Sep 24, 2009 at 12:22 PM, Ms swati chande wrote: > > Sorry for resending, it got stalled. > Have subscribed to pgsql-general now. > > >What query, exactly?  Which PG version is this? > >            regards, tom lane > Its a query involving 15 relations, processing not more than 500 records

[GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-24 Thread InterRob
Dear List, I am trying to implement the following: In a database I wish to implement a GENERIC datamodel, thus on a meta-level. All RELATIONS (part of a MODEL) will be a view on some base (being a table) JOINed with (an) extra column(s). Thus, this view consists of a number of FIELDS. I whish to m

[GENERAL] Exception 0xC0000005

2009-09-24 Thread Ms swati chande
Sorry for resending, it got stalled. Have subscribed to pgsql-general now.   >What query, exactly?  Which PG version is this? >            regards, tom lane Its a query involving 15 relations, processing not more than 500 records. The query is written in a .sql file and the file is executed as

Re: [GENERAL] How to have ant's task insert special chars appropriately?

2009-09-24 Thread agostonbejo
Hi Richard, thanks for the answer! Nevertheless, see below... ;) > Richard Huxton wrote: > agostonbejo wrote: > > > > Hi! > > > > What I'm trying to do is to insert some data from a sql file into a > postgres > > DB by calling the ant task. My problem is that I can't get special > > charact

Re: [GENERAL]

2009-09-24 Thread Ms swati chande
>What query, exactly?  Which PG version is this? >            regards, tom lane Its a query involving 15 relations, processing not more than 500 records. The query is written in a .sql file and the file is executed as   \i initq.sql   Infact, know no .sql file is getting executed. All my .sqls

[GENERAL] repeatedly process termination in PG 8.2

2009-09-24 Thread Michael Molz
Hi there, one of our systems on a PG 8.2 database crashes nearly daily; others are running fine. Host OS of this system is Windows, if the db crashes nothing is written in the OS event logs. The database log show every time the following messages: 2009-09-23 10:21:30 LOG: server proce

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Joshua Tolley
On Thu, Sep 24, 2009 at 05:09:26PM +0200, Cédric Villemain wrote: > > Bucardo is a good choice for this usage model because it was > > originally designed to work over a lossy network connections. > > yes, but isn't bucardo designed to 2 nodes only ? Bucardo's multi-master replication works only

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Cédric Villemain
Le jeudi 24 septembre 2009, Selena Deckelmann a écrit : > Hi! > > On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery wrote: > > Hi, > > I'm looking for a way to replicate am master database to multiple (100+) > > databases that are taken in to the field. Currently for each laptop we > > dump and

[GENERAL] What is the difference of these two kinds of foreign key defination?

2009-09-24 Thread sheepjxx
To be precise, The difference between create table a ( foreign key (id) referenced by b(name), ); create table b( id integer referenced by b(name), );

Re: [GENERAL] Understanding 'could not read block'

2009-09-24 Thread Tom Lane
=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= writes: > On Thu, Sep 24, 2009 at 1:14 PM, stevesub wrote: >> I get an error: >> ERROR: could not read block 8519713 of temporary file: Permission denied > try switching off any antivirus software running. The usual advice is to actually *uninstall* whateve

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Selena Deckelmann
Hi! On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery wrote: > Hi, > I'm looking for a way to replicate am master database to multiple (100+) > databases that are taken in to the field. Currently for each laptop we dump > and load the tables. However,there is only a small percentage of data that

Re: [GENERAL] What is the difference of foreign key?

2009-09-24 Thread serge.fonville
Hi, Read http://www.postgresql.org/docs/8.4/static/sql-createtable.html > REFERENCES *reftable* [ ( *refcolumn* ) ] [ MATCH *matchtype* ] [ ON > DELETE *action* ] [ ON UPDATE *action* ] (column constraint) > FOREIGN KEY ( *column* [, ... ] ) REFERENCES *reftable* [ ( *refcolumn* [, > ... ] ) ] [

[GENERAL] What is the difference of foreign key?

2009-09-24 Thread sheepjxx
To be precise, The difference between create table a ( foreign key (id) referenced by b(name), ); create table b( id integer referenced by b(name), );

Re: [GENERAL] Intermediate values and unprivileged users

2009-09-24 Thread Grzegorz Jaśkiewicz
Use subselect... SELECT f.foo, (CASE WHEN f.foo > 'something' THEN ...) FROM ( SELECT ) f;

[GENERAL] What is the difference of foreign key?

2009-09-24 Thread 纪晓曦
To be precise, The difference between create table a ( foreign key (id) referenced by b(name), ); create table b( id integer referenced by b(name), );

[GENERAL] Intermediate values and unprivileged users

2009-09-24 Thread Mark Morgan Lloyd
My apologies if this is an FAQ or considered too general. I have a query like this which returns a single result: SELECT ( (SELECT avg(rel_pressure) as avg4 FROM weather WHERE now() - datetime <= '4 hours' ) - (SELECT avg(rel_pressure) as avg24 FROM weather WHERE now() - da

Re: [GENERAL] Understanding 'could not read block'

2009-09-24 Thread Grzegorz Jaśkiewicz
On Thu, Sep 24, 2009 at 1:14 PM, stevesub wrote: > > Hi, > > I have a table of about 693 million rows (80gb) of position data (standard > object,timestamp,position,etc). > > Every time I try to build some statistics by creating a table, such as: > > create table pos_stats1 as > > select id,year,m

[GENERAL] Understanding 'could not read block'

2009-09-24 Thread stevesub
Hi, I have a table of about 693 million rows (80gb) of position data (standard object,timestamp,position,etc). Every time I try to build some statistics by creating a table, such as: > create table pos_stats1 as > select id,year,month,count(1) from positions group by id,year,month; I get an err

[GENERAL] SqlDataSource and npsql

2009-09-24 Thread Keller, Oliver
Hi all, since a while I try to configure npgsql as a .NET data provider for SqlDataSource control in Visual Studio 2008 prof.. Npsql does not appear in the drop down list of data providers. I have done the following configurations: machine.config: web.config (C:\Windows\Microsoft.NET\F

[GENERAL] primary key and foreign keys

2009-09-24 Thread Grzegorz Jaśkiewicz
Hi folks, I am trying to do a little bit of changes in one of my DBs, basically it involves changing primary keys to just unique index (the columns are already not null); I was thinking about just dropping Pk in transaction, creating unique index, and creating PK on other column), but I can't do t

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Alexey Klyukin
Hi, On Wed, Sep 23, 2009 at 8:11 PM, Bryan Montgomery wrote: > Hi, > I'm looking for a way to replicate am master database to multiple (100+) > databases that are taken in to the field. Currently for each laptop we dump > and load the tables. However,there is only a small percentage of data that

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Sam Mason
On Wed, Sep 23, 2009 at 06:00:03PM -0400, Bryan Montgomery wrote: > Thanks for the reply. This is a one way push to the slaves. In theory, there > shouldn't be any conflicts although I wouldn't swear to that. If > there's a conflict, the master db should win. At the moment we just drop the > t

Re: [GENERAL] Looking for way to replicate master db to multiple mobile databases

2009-09-24 Thread Bryan Montgomery
Thanks for the reply. This is a one way push to the slaves. In theory, there shouldn't be any conflicts although I wouldn't swear to that. If there's a conflict, the master db should win. At the moment we just drop the tables, recreate the schema and reload the tables. However, some of the lar

[GENERAL] pg_toast record in table pg_class

2009-09-24 Thread Mihail Nasedkin
Hi. I accidentally deleted pg_toast record from pg_class table that belongs to regular table (reltoastrelid). Now [select * from table_name] not work: ERROR:  could not open relation with OID [oid_of_pg_toast_table] Is it possible to restore corruption table? -- --- Regards, M.Nasedkin -- Se