Re: [GENERAL] What is your favorite front end for user interaction to postgresql databases?

2006-05-08 Thread Guido Neitzer

On 09.05.2006, at 0:33 Uhr, Karen Hill wrote:


What is your favorite front end for end users to interact with your
postgresql db?  Is it java, .net, web apache + php, MS-Access, ruby on
rails?  Why is it your favorite?  Which would you recommend for end
users on multiple OSes?


You mean what technology to use to build business logic?



It just depends on your needs. I prefer to use Apple WebObjects for  
building web frontends to the db.


Why? Because it is extremely powerful, free if you are able to  
develop on Mac OS X (it comes with the developer tools) and even if  
you have to buy a couple of Powerbooks and Xserves it may be cheaper  
then only the software license for one of the other big Java  
application server technologies. You can deploy it to every Java  
plattform because it's just a Java application, but it's build on and  
for Mac OS X. It completely frees you from thinking in tables, joins,  
selects and other sql stuff, well, at least nearly completely. I can  
switch my whole application including a couple of hundred MB database  
content in half a day (mostly the time to transfer the data) - I have  
done this two months ago from another dbms to PostgreSQL.


It's just as "cool" as Ruby on Rails right now, not as fat and slow  
in development as most J2EE servers, you can deploy everywhere, I can  
develop on Mac OS X (yes, that's a reason for me, because it speeds  
up my work by a good percentage), it is extremely fast for  
development once you have the concepts and a good set of your own  
components in stock which you are used to. It's pure Java, so I can  
easily include third party tools like Lucene or others. It does one  
connection per application instance which keeps concurrent db tasks  
low. Also it has more than one working approach for multi language /  
internationalized applications.


And, most important, it has a tool, which enables me to do things  
alone in days, other teams do in weeks with other J2EE tools:  
DirectToWeb - a rule and template driven dev plattform. You write the  
db schema, lots of "rules" how list, inspect, edit and search pages  
should look like and some basic html for wrappers and you can create  
an administration application faster as with everything I've seen so  
far. Including Ruby on Rails, PHP and other Java tools. But, to make  
this clear: the starting point to use it is VERY high. I had  a  
couple of years doing WebObjects development when I started using D2W  
and it was good to have this background.


Also you can build WebServices, rich Java client apps, can use Ajax  
for rich web applications and I have a tool that proved it's  
scalability, reliability and ease of use in a real high volume  
environment: the iTunes Music Store.


For more information, send me an email and/or go to www.apple.com/webobjects>. (I hope the url is correct, I'm not online  
right now - sitting in the train to work  ;-))


Ah, and if you download it for testing: go to one of the WO mailing  
lists and ask for some good tips for starters. It will help.




Also, what do you think of having the database management system do  
all

work (business logic etc) with the front end as a user interface vs.
having N-tier with an application server handling business logic, and
the db just accepting data.


I prefer the second approach because it frees me from one specific  
database. I can use Oracle, PostgreSQL, MySQL, FrontBase, OpenBase,  
Sybase, MSSQL without changing one line of code (if I have avoided  
using custom SQL, which I mostly do) by just switching one framework.  
Okay, right, there are always some problems you have to solve, but  
they are nothing compared to what a PHP developer has to do to use  
different dbms as the one he develops on.



This comes from having to re-invent the wheel every time a
new user app needs to  be created.


You do something wrong if you don't build libraries of your basic and  
generic work over the time. This has nothing to do with the tool you  
use or the underlying dbms - it's just bad coding style if you have  
to re-invent the wheel for every app.


For me and our customers it's more important to be able to switch the  
dbms than the application server.


But, as with everything: YMMV.

Ah, and for curiosity I'm just evaluating Ruby on Rails: it has  
interesting ideas and places itself somewhere between the fat J2EE  
app servers and the scripting languages PHP and Perl. It is more  
closely placed to WebObjects then I have thought on the first look,  
but is a bit easier to learn and not the big 800 pound gorilla of web  
development, with hooks, tool, templates, ideas and concepts for  
nearly every case.


But in my opinion it lacks a couple of things, two of the most  
important for me are complete abstraction from the db (you may reach  
this with easy schemas and generic sql but not enough) and a working  
internationalization approach. It is lightweight and it would be  
interesting to build 

[GENERAL] how to debugg

2006-05-08 Thread N Srinivasa

Hi

I downloded postgresql source code, and compile it in windows platform, can
any body plz tell me that how can i debug the sourcecode in windows 
platform,

what are the steps are i should go through..

Regards
Srinivasa

_
Spice up your IM conversations. New, colorful and animated emoticons. Get 
chatting! http://server1.msn.co.in/SP05/emoticons/



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] exporting quoted CSV data from a query

2006-05-08 Thread David Fetter
On Mon, May 08, 2006 at 12:26:48PM -0700, George Pavlov wrote:
> Is there a way to export the output of an arbitrary SQL query to a
> quoted CSV file? 

For now, you can do it with a temp table, as in:

BEGIN;
CREATE TEMP TABLE my_temp AS SELECT ...;
COPY my_temp ... ;
ROLLBACK;

HTH :)

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] What is your favorite front end for user interaction

2006-05-08 Thread Joshua D. Drake

Michael Schmidt wrote:
I agonized over this decision when I migrated my application to 
PostgreSQL.  I know Tony Caduto likes Delphi and he can give some good 
reasons for this (are you out there, Tony?).  There has also been a good 
article recently about Ruby on Rails.


Well it depends on your needs. I am partial to:

http://www.djangoproject.com for web stuff but I also hear really good 
things about Turbogears. Both of these are Python based which has 
excellent cross platform capabilities (including Win32).


In general Ruby on Rails *feels* like more a vehicle with 600 HP just to 
drive 10 miles to work. Why?


Also in terms of Delphi... I would actually pick Python over Delphi at 
this point.  I like Delphi and have actually written a couple of 
articles on Kylix (Delphi for Linux) but IMHO the time for closed 
languages is over.


Use a language that is OSS and actively developed. Python, Ruby or if 
you must Perl or Java ;)


Joshua D. Drake

On the second question, I also like to have the database do as much of 
the work as possible. 
 
Michael Schmidt



--

   === The PostgreSQL Company: Command Prompt, Inc. ===
 Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
 Providing the most comprehensive  PostgreSQL solutions since 1997
http://www.commandprompt.com/



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] pg_restore duplicate key violations

2006-05-08 Thread Tom Lane
"Karl O. Pinc" <[EMAIL PROTECTED]> writes:
> I'm having trouble with a dump and restore:

> $ pg_dump --format=t --schema=babase --data-only --user babase_admin  
> babase_test | pg_restore --data-only --disable-triggers --user  
> babase_admin --dbname=babase
> pg_restore: ERROR:  duplicate key violates unique constraint  
> "activities_pkey"
> CONTEXT:  COPY activities, line 1: "B   t   t   Be groomed"

Um ... it looks to me like you're trying to restore into an existing
table that already has the same data loaded ...

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] What is your favorite front end for user interaction to postgresql databases?

2006-05-08 Thread Michael Schmidt



I agonized over this decision when I migrated my application to 
PostgreSQL.  I know Tony Caduto likes Delphi and he can give some good 
reasons for this (are you out there, Tony?).  There has also been a good 
article recently about Ruby on Rails.  For my purposes, I wanted to 
maximize cross-platform compatibility and decided on Java.  I was advised 
(correctly, I think) to opt for SWT rather than standard Java Swing and 
ended up with Eclipse.  I must say that Eclipse has not been particularly 
easy to learn - the documentation is quite uneven and the mail lists aren't 
nearly as helpful as with the PostgreSQL community.  Also, Eclipse is 
changing so quickly that books have a hard time keeping up.  Nevertheless, 
it is powerful and I've found it rewarding.  To make things easier for 
others, I uploaded a basic Eclipse front end (without editors, views, and 
reports) to pgFoundry (Komo PostgreSQL Client).
 
On the second question, I also like to have the database do as much of the 
work as possible.  
 
Michael Schmidt


Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Joshua D. Drake

Hello,

What version of PostgreSQL is this that you are using? Because it 
behaves like no other postgresql I have ever seen. Please see below:



[EMAIL PROTECTED]:~$ bin/initdb -D data2
The files belonging to this database system will be owned by user 
"postgres".

This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.

creating directory data2 ... ok
creating directory data2/global ... ok
creating directory data2/pg_xlog ... ok
creating directory data2/pg_xlog/archive_status ... ok
creating directory data2/pg_clog ... ok
creating directory data2/pg_subtrans ... ok
creating directory data2/pg_twophase ... ok
creating directory data2/pg_multixact/members ... ok
creating directory data2/pg_multixact/offsets ... ok
creating directory data2/base ... ok
creating directory data2/base/1 ... ok
creating directory data2/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ...
bin1000
creating configuration files ... /ok
creating template1 database in data2/base/1 ... ok
initializing pg_authid ... pgok
enabling unlimited row size for system tables ... _ctok
initializing dependencies ... l -ok
creating system views ... D daok
loading pg_description ... ta2ok
creating conversions ...  start
ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

bin/postmaster -D data2
or
bin/pg_ctl -D data2 -l logfile start

[EMAIL PROTECTED]:~$
[EMAIL PROTECTED]:~$ bin/pg_ctl -D data2 start
postmaster starting
[EMAIL PROTECTED]:~$ LOG:  database system was shut down at 2006-05-08 
16:28:44 PDT

LOG:  checkpoint record is at 0/38FFE0
LOG:  redo record is at 0/38FFE0; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 565; next OID: 10794
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
LOG:  transaction ID wrap limit is 2147484146, limited by database 
"postgres"


[EMAIL PROTECTED]:~$ bin/psql -U postgres
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help with psql commands
   \g or terminate with semicolon to execute query
   \q to quit

postgres=# create user test1;
CREATE ROLE
postgres=# create user test2;
CREATE ROLE
postgres=# create database test1 owner test1;
LOG:  transaction ID wrap limit is 2147484146, limited by database 
"postgres"

CREATE DATABASE
postgres=# create database test2 owner test2;
LOG:  transaction ID wrap limit is 2147484146, limited by database 
"postgres"

CREATE DATABASE
postgres=# \q
[EMAIL PROTECTED]:~$ psql -U test1 test1;
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help with psql commands
   \g or terminate with semicolon to execute query
   \q to quit

test1=> create table foo(id bigserial);
NOTICE:  CREATE TABLE will create implicit sequence "foo_id_seq" for 
serial column "foo.id"
NOTICE:  CREATE TABLE will create implicit sequence "foo_id_seq" for 
serial column "foo.id"

CREATE TABLE
test1=> \q
[EMAIL PROTECTED]:~$ psql -U test2 test2;
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help with psql commands
   \g or terminate with semicolon to execute query
   \q to quit

test2=> create table foo2(id bigserial);
NOTICE:  CREATE TABLE will create implicit sequence "foo2_id_seq" for 
serial column "foo2.id"
NOTICE:  CREATE TABLE will create implicit sequence "foo2_id_seq" for 
serial column "foo2.id"

CREATE TABLE
test2=> \q
[EMAIL PROTECTED]:~$ pg_dump test1;
--
-- PostgreSQL database dump
--

SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';


SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: foo; Type: TABLE; Schema: public; Owner: test1; Tablespace:
--

CREATE TABLE foo (
id bigserial NOT NULL
);


ALTER TABLE public.foo OWNER TO test1;

--
-- Name: foo_id_seq; Type: SEQUENCE SET; Schema: public; Owner: test1
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('foo', 'id'), 
1, false);



--
-- Data for Name: foo; Type: TABLE DATA; Schema: public; Owner: test1
--

COPY foo (id) FROM stdin;
\.


--
-- Name: public; Type: ACL; Schema: -; Owner: po

Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Tom Lane
Blair Lowe <[EMAIL PROTECTED]> writes:
> On Mon, 2006-08-05 at 15:54 -0700, Joshua D. Drake wrote:
>> Do you mean pg_dumpall? Because pg_dump will ONLY dump the database you 
>> specify, nothing else.

> That would be nice, but it is not true.

Joshua is 100% correct about this; I do not know what you are seeing
exactly, but your interpretation of it is wrong (unless someone has
actually substituted pg_dumpall for pg_dump on your machine).

My best theory at the moment is that somewhere along the way you (or
someone) mistakenly created a bunch of stuff in the template1
database, and it is therefore getting copied into any new databases
made by CREATE DATABASE.  See the discussion of template databases
in the manual.

If this is what has happened, it's possible to drop template1 and
recreate a pristine version from template0; there's a step-by-step
recipe on techdocs IIRC.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Blair Lowe
On Mon, 2006-08-05 at 15:54 -0700, Joshua D. Drake wrote:
> > Not sure how else to describe this: basically if you type in pg_dump
> >  then all databases on the system that have table grants
> > to public are also in the backup .sql file with connect commands to the
> > other database users.
> 
> Do you mean pg_dumpall? Because pg_dump will ONLY dump the database you 
> specify, nothing else.

That would be nice, but it is not true.

Try this:

as user1: createdb test1
psql test1
>create table stuff1 (
  a CHAR(3)
);

as user2: createdb test2
pgsql test2
>create table stuff2 (
  a CHAR(3)
);
>grant all on stuff2 to PUBLIC;

now again as user1:
pg_dump test1

You should see the table stuff2 of test2 in there.

phpBB2 and many other mysql based software packages grant all tables to
PUBLIC so that the web user can alter stuff.

Blair.


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] What is your favorite front end for user interaction to postgresql databases?

2006-05-08 Thread Casey Duncan

On May 8, 2006, at 3:33 PM, Karen Hill wrote:


What is your favorite front end for end users to interact with your
postgresql db?  Is it java, .net, web apache + php, MS-Access, ruby on
rails?  Why is it your favorite?  Which would you recommend for end
users on multiple OSes?


This is totally dependent on the individual user's preference:

- Many users comfortable with command line shells prefer psql (this  
is my choice).

- Others who like a gui might use pgAdmin (or miriad others)
- If interoperability with MSOffice is your main concern, I could see  
Access/ODBC being useful. As a general front-end, probably not.


When you start talking about java v. .net v. php vs. ruby, that's a  
whole other ball of wax. That's a lot less about interaction, or even  
about databases and a lot more about programmer preference.  
Personally, I would recommend:


Python + psycopg (highly interactive, great for complex scripts or  
even apps)
Java + JDBC + Hibernate (I think JDBC sucks, but Hibernate totally  
rocks and more or less hides it from you)
Shell + psql (great for simple reporting, automating dba tasks, etc.  
etc)


Also, what do you think of having the database management system do  
all

work (business logic etc) with the front end as a user interface vs.
having N-tier with an application server handling business logic, and
the db just accepting data.  I currently have the opinion that N-tier
is not as good as having the db contain the business logic via stored
procedures.  This comes from having to re-invent the wheel every  
time a

new user app needs to  be created.


From personal experience (and others will disagree), I find putting  
logic in the database to be a bad idea. I only use stored procedures  
for triggers and the like, and I try to avoid those whenever possible.


Here are my reasons why:

- I don't like the PL/pgSQL language (yes there are alternatives, but  
they have their own drawbacks)
- It's complex to test and upgrade (we actually wrote non-trivial  
infrastructure to automate both)
- It's difficult to debug (compared to external languages like python  
or java)
- It's difficult to profile, therefore getting good performance can  
be difficult


I had a very complex system coded in stored procedures that performed  
poorly and was hard to maintain. It's now refactored into java/ 
hibernate code that's simpler to understand, performs much better and  
is easy to extend and maintain. Of course that's just my particular  
case and obviously YMMV.


Stored procs could make a lot of sense if you have many different  
clients accessing the db in different ways and you want to strictly  
enforce business rules across all of them. I had no such requirements  
in my case.


In any case I would strongly recommend doing the simplest thing that  
you can get away with. If your business rules can be fulfilled with  
grants, views and constraints alone, use them.


-Casey

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] What is your favorite front end for user interaction

2006-05-08 Thread Kenneth Downs

Karen Hill wrote:


What is your favorite front end for end users to interact with your
postgresql db?  Is it java, .net, web apache + php, MS-Access, ruby on
rails?  Why is it your favorite?  Which would you recommend for end
users on multiple OSes?
 


I use PHP for the same reason I use Postgres, easy, powerful, and free.


Also, what do you think of having the database management system do all
work (business logic etc) with the front end as a user interface vs.
having N-tier with an application server handling business logic, and
the db just accepting data.  I currently have the opinion that N-tier
is not as good as having the db contain the business logic via stored
procedures.  This comes from having to re-invent the wheel every time a
new user app needs to  be created.
 

Agreed.  I like to have the database do all of the work, and I like to 
use a dictionary-based generator to build the triggers for me.


Shameless plug: My own project, Andromeda, which does just this, is a 
GPL project using PHP and PostgreSQL which works as you describe.  
http://docs.secdat.com.  I consider the project late-beta for my own 
projects, but probably early Alpha for others, since there are probably 
foibles that don't bother me because I wrote it and know where they are.
begin:vcard
fn:Kenneth  Downs
n:Downs;Kenneth 
email;internet:[EMAIL PROTECTED]
tel;work:631-689-7200
tel;fax:631-689-0527
tel;cell:631-379-0010
x-mozilla-html:FALSE
version:2.1
end:vcard


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Joshua D. Drake



Not sure how else to describe this: basically if you type in pg_dump
 then all databases on the system that have table grants
to public are also in the backup .sql file with connect commands to the
other database users.


Do you mean pg_dumpall? Because pg_dump will ONLY dump the database you 
specify, nothing else.


Joshua D. Drake




Restoring, therefor, is not possible by that user because the restore
procedure wants to restore other databases that are not owned by the
owner of the database that was supposed to be backed up. 


TTYL,
Blair.


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster




--

   === The PostgreSQL Company: Command Prompt, Inc. ===
 Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
 Providing the most comprehensive  PostgreSQL solutions since 1997
http://www.commandprompt.com/



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[GENERAL] What is your favorite front end for user interaction to postgresql databases?

2006-05-08 Thread Karen Hill
What is your favorite front end for end users to interact with your
postgresql db?  Is it java, .net, web apache + php, MS-Access, ruby on
rails?  Why is it your favorite?  Which would you recommend for end
users on multiple OSes?

Also, what do you think of having the database management system do all
work (business logic etc) with the front end as a user interface vs.
having N-tier with an application server handling business logic, and
the db just accepting data.  I currently have the opinion that N-tier
is not as good as having the db contain the business logic via stored
procedures.  This comes from having to re-invent the wheel every time a
new user app needs to  be created.


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Blair Lowe
On Tue, 2006-09-05 at 00:09 +0200, Martijn van Oosterhout wrote:
> On Mon, May 08, 2006 at 03:47:13PM -0600, Blair Lowe wrote:
> > If I want to back up a client's database on our shared web server, I
> > would type:
> > 
> > pg_dump 
> > 
> > Since we are running a shared server, and since crappy (only because of
> > this problem) off the shelf database open source software such as
> > oscommerce, or phpBB2 grants access to public rather than the web user
> > "www" or "nobody", when I do a pg_dump for a database, I get all the
> > databases on the system that grant to PUBLIC being dumped with with
> > database that I want.
> 
> pg_dump only ever connects to a single database, so it seems very
> unlikely that it would dump a different database. Could you be a little
> more specific about what is happening? Oh, and the version of postgres
> and platform you are using would also be helpful.

postgreSQL 7.3.4 on rh 9


Not sure how else to describe this: basically if you type in pg_dump
 then all databases on the system that have table grants
to public are also in the backup .sql file with connect commands to the
other database users.

Restoring, therefor, is not possible by that user because the restore
procedure wants to restore other databases that are not owned by the
owner of the database that was supposed to be backed up. 

TTYL,
Blair.


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Martijn van Oosterhout
On Mon, May 08, 2006 at 03:47:13PM -0600, Blair Lowe wrote:
> If I want to back up a client's database on our shared web server, I
> would type:
> 
> pg_dump 
> 
> Since we are running a shared server, and since crappy (only because of
> this problem) off the shelf database open source software such as
> oscommerce, or phpBB2 grants access to public rather than the web user
> "www" or "nobody", when I do a pg_dump for a database, I get all the
> databases on the system that grant to PUBLIC being dumped with with
> database that I want.

pg_dump only ever connects to a single database, so it seems very
unlikely that it would dump a different database. Could you be a little
more specific about what is happening? Oh, and the version of postgres
and platform you are using would also be helpful.

Have a nice day,
-- 
Martijn van Oosterhout  http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.


signature.asc
Description: Digital signature


Re: [GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread John Purser
On Mon, 08 May 2006 15:47:13 -0600
Blair Lowe <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have had this problem for a while, and have not been able to find
> anything in the archives or on search engines:
> 
> If I want to back up a client's database on our shared web server, I
> would type:
> 
> pg_dump 
> 
> Since we are running a shared server, and since crappy (only because
> of this problem) off the shelf database open source software such as
> oscommerce, or phpBB2 grants access to public rather than the web user
> "www" or "nobody", when I do a pg_dump for a database, I get all the
> databases on the system that grant to PUBLIC being dumped with with
> database that I want.
> 
> To restore, I need to go in and prune out all the extra junk that was
> granted to PUBLIC by other users in other databases - very time
> consuming.
> 
> How can I use pg_dump to get JUST the database in th argument, and not
> other tables and databases that have granted to PUBLIC?
> 
> Altering my client's software to grant to "nobody" is not practical.
> 
> Thanks in advance,
> Blair.
> 
> 
> ---(end of
> broadcast)--- TIP 2: Don't 'kill -9' the
> postmaster

Blair,


How about setting up a seperate schema (private), adding your
customer's database to it (leaving it in public) and then backing up
private.customerdb?


John Purser

-- 
You need more time; and you probably always will.

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[GENERAL] pg_dump and grants to PUBLIC

2006-05-08 Thread Blair Lowe
Hi,

I have had this problem for a while, and have not been able to find
anything in the archives or on search engines:

If I want to back up a client's database on our shared web server, I
would type:

pg_dump 

Since we are running a shared server, and since crappy (only because of
this problem) off the shelf database open source software such as
oscommerce, or phpBB2 grants access to public rather than the web user
"www" or "nobody", when I do a pg_dump for a database, I get all the
databases on the system that grant to PUBLIC being dumped with with
database that I want.

To restore, I need to go in and prune out all the extra junk that was
granted to PUBLIC by other users in other databases - very time
consuming.

How can I use pg_dump to get JUST the database in th argument, and not
other tables and databases that have granted to PUBLIC?

Altering my client's software to grant to "nobody" is not practical.

Thanks in advance,
Blair.


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] simple md5 authentication problems

2006-05-08 Thread Bruno Wolff III
On Mon, May 08, 2006 at 23:10:31 +0900,
  kmh496 <[EMAIL PROTECTED]> wrote:
> doesn't that user have to exist since you are using ident method?  that
> means unix username == postgres username.
> do you have a user named maragato_test on the system?  
> did you create that user in postgres and on the system?

Note that you can create custom mappings for which the unix user is not
the same as the postgres user.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] intarray internals

2006-05-08 Thread Tom Lane
Volkan YAZICI <[EMAIL PROTECTED]> writes:
> [I'm trying to share some of my thoughts about intarray contrib module.
> If this is the wrong way to achieve this, please warn me. (Should I
> first get in touch with Teodor Sigaev and Oleg Bartunov?)]

Well, they're definitely the people most qualified to review your
proposed changes.  More to the point, this discussion is quite off-topic
for pgsql-general.  If I were you I'd be posting these comments to
pgsql-hackers with cc's to Teodor and Oleg.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[GENERAL] exporting quoted CSV data from a query

2006-05-08 Thread George Pavlov
Is there a way to export the output of an arbitrary SQL query to a
quoted CSV file? 

It seems that the COPY command can do that for regular tables (COPY foo
TO STDOUT WITH CSV QUOTE AS '"') but not for a query result. I could
create temp tables in a script but it seems that there should be a
simpler alternative.

The command-line psql can obviously be used with an arbitrary query, but
seems to fail on the quoting part--am I missing some option to psql that
would put quotes around fields that contain the quote character,
newlines, etc.?

What I am looking for is essentially a command-line alternative to the
pgAdmin export's "quoting" options.

George

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[GENERAL] pg_restore duplicate key violations

2006-05-08 Thread Karl O. Pinc

Hello,

PostgreSQL 8.1.3, Centos 4.2

I'm having trouble with a dump and restore:

$ pg_dump --format=t --schema=babase --data-only --user babase_admin  
babase_test | pg_restore --data-only --disable-triggers --user  
babase_admin --dbname=babase
pg_restore: ERROR:  duplicate key violates unique constraint  
"activities_pkey"

CONTEXT:  COPY activities, line 1: "B   t   t   Be groomed"
pg_restore: [archiver (db)] error returned by PQendcopy: ERROR:   
duplicate key violates unique constraint "activities_pkey"

CONTEXT:  COPY activities, line 1: "B   t   t   Be groomed"

The two databases/schemas are identical.

I bumped around the list archives and found a post that seemed
to indicate locale could be a problem.  When I did an initdb
to initialize the cluster I made sure that the locale was C,
and all the LC_ options in postgresql.conf are shown
as C and "show all" shows them all as C in both databases.

The locale in my shell is all en_US.UTF-8 so I tried setting
LC_CHAR and LC_COLLATE to C in the shell before running
the dump/restore and this did not work.  Likewise with LC_ALL.
I also tried exporting LC_CHAR and LC_COLLATE as C in
/etc/sysconfig/pgsql/postgresql so that the server would run
in the correct locale, just in case, but this did not work either.

If it matters when installing postgres I recompiled the
source rpm so as to make it an i686.

Where do I go from here?

Thanks.

Karl <[EMAIL PROTECTED]>
Free Software:  "You don't pay back, you pay forward."
 -- Robert A. Heinlein


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [GENERAL] intarray internals

2006-05-08 Thread Volkan YAZICI
Hi,

[I'm trying to share some of my thoughts about intarray contrib module.
If this is the wrong way to achieve this, please warn me. (Should I
first get in touch with Teodor Sigaev and Oleg Bartunov?)]

[6]
_int_same() in _int_op.c looks like making some redundant sorting and
not taking advantage of sorted arrays while comparing each other. Here's
the related code piece:

SORT(a);
SORT(b);
na = ARRNELEMS(a);
nb = ARRNELEMS(b);
da = ARRPTR(a);
db = ARRPTR(b);

result = FALSE;

if (na == nb)   
   
{   
result = TRUE;
for (n = 0; n < na; n++)
if (da[n] != db[n])
{
result = FALSE;
break;
}
}

IMHO, SORT() macro should be called after "if (na == nb)" block. (SORT()
doesn't remove duplicates.) Also, in the inner block, while comparing
two arrays, we can take advantage of sorting of arrays. While current
behaviour is like

if (A[0] == B[0] && A[1] == B[1] && ...)

we can replace it with sth like

if (A[0] == B[0] && A[  N] == B[  N] &&
A[1] == B[1] && A[N-1] == B[N-1] &&
...)

Attached patch tries to implement both behaviours mentioned above and
some minor hacking for arrays of 1,2 and 3 items.


Regards.
Index: contrib/intarray/_int_op.c
===
RCS file: /projects/cvsroot/pgsql/contrib/intarray/_int_op.c,v
retrieving revision 1.4
diff -c -r1.4 _int_op.c
*** contrib/intarray/_int_op.c  19 Nov 2005 03:00:09 -  1.4
--- contrib/intarray/_int_op.c  8 May 2006 18:50:43 -
***
*** 69,77 
ArrayType  *b = (ArrayType *) 
DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(1)));
int na,
nb;
-   int n;
-   int*da,
-  *db;
boolresult;
boolavoid;
boolbvoid;
--- 69,74 
***
*** 83,106 
if (avoid || bvoid)
return (avoid && bvoid) ? TRUE : FALSE;
  
-   SORT(a);
-   SORT(b);
na = ARRNELEMS(a);
nb = ARRNELEMS(b);
!   da = ARRPTR(a);
!   db = ARRPTR(b);
! 
result = FALSE;
  
if (na == nb)
{
!   result = TRUE;
!   for (n = 0; n < na; n++)
!   if (da[n] != db[n])
!   {
!   result = FALSE;
break;
}
}
  
pfree(a);
--- 80,155 
if (avoid || bvoid)
return (avoid && bvoid) ? TRUE : FALSE;
  
na = ARRNELEMS(a);
nb = ARRNELEMS(b);
!   
result = FALSE;
  
if (na == nb)
{
!   int *da;
!   int *db;
!   
!   SORT(a);
!   SORT(b);
!   da = ARRPTR(a);
!   db = ARRPTR(b);
! 
!   switch (na)
!   {
!   /*
!* Some little hack for small length arrays.
!*/
!   case 1:
!   result = (da[0] == db[0]) ? TRUE : FALSE;
break;
+ 
+   case 2:
+   result = (da[0] == db[0] &&
+ da[1] == db[1]) ? TRUE : 
FALSE;
+   break;
+ 
+   case 3:
+   result = (da[0] == db[0] &&
+ da[1] == db[1] &&
+ da[2] == db[2]) ? TRUE : 
FALSE;
+   break;
+ 
+   /*
+* Instead of making a brute force comparison, trying 
to take
+* advantage of sorted arrays.
+*/
+   default:
+   {
+   int head = 0;
+   int toe = na - 1;
+   
+   result = TRUE;
+   
+   /*
+* Don't bother with even length arrays. 
Consume their first
+* element and carry on as arrays' lengths are 
odd.
+*/
+   if (na % 2 == 0)
+   {
+   result = (*da++ == *db++) ? TRUE : 
FALSE;
+   toe--;
+   }
+   
+   if (result == TRUE)
+   while (head <= toe)
+   {
+ 

Re: [GENERAL] Using the REPLACE command to replace all vowels

2006-05-08 Thread George Pavlov
Is there any requirement that you have to use REPLACE? Another (possibly
better) way to do the same is by doing:

  select translate(your_string,'aeiou','') from your_table;
 
In my experience that performs much better than regexp. I just ran it on
a table of about 100K random U.S addresses and TRANSLATE outperforms
REGEXP_REPLACE by a factor of 2. I would use TRANSLATE unless you need
some of the heavier lifting that REGEXP can provide.



> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey
> Sent: Sunday, May 07, 2006 3:54 PM
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Using the REPLACE command to replace all vowels
> 
> Magnus Hagander wrote:
> >> Is there a way to make seperate replacements in 1 field in 
> >> one command in SQL?
> >>
> >> I need to remove all vowels (a,e,i,o,u) in a field. How would 
> >> I go about that?
> > 
> > Try something like
> > SELECT regexp_replace(your_string,'[aeiou]','','g') ...
> > 
> > (btw, if you want all vowels, don't forget 'y' :-P)
> 
> As I recall, that should be 'and sometimes y...  I don't 
> recall the sql 
> syntax for SOMETIMES :)
> 
> -- 
> Until later, Geoffrey
> 
> Any society that would give up a little liberty to gain a little
> security will deserve neither and lose both.  - Benjamin Franklin
> 
> ---(end of 
> broadcast)---
> TIP 5: don't forget to increase your free space map settings
> 

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] database size grows (even after vacuum (full and analyze))....

2006-05-08 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes:
> In the long run, you should upgrade. 7.2 is essentially without support. I
> beleive there is still a RHEL version using it that is in support, so a
> critical fix might get back ported.

No, Red Hat never shipped a RHEL version using 7.2.* (they went straight
from 7.1 to 7.3).  This is not unrelated to the fact that the community
dropped support for 7.2, actually --- I'm sure we'd not be maintaining
7.3 anymore either, if I weren't personally on the hook to support 7.3
for RHEL3.

Bottom line is there's no one out there maintaining 7.2 at all, and even
7.3 and 7.4 are really not getting anything but the most critical bug fixes.

regards, tom lane

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] database size grows (even after vacuum (full and analyze))....

2006-05-08 Thread Joao Miguel Ferreira
On Mon, 2006-05-08 at 18:07, Bruno Wolff III wrote:
> Please keep replies copied to the list so that others can learn from and
> contribute to the discussion. I don't remember where this was, but it looks
> like general is probably reasonable.

Sorry. I didn't notice. I'll keep that in mind.

> > 
> > Yes, my tables contains ever grwoing values afected by a UNIQUE
> > constraint.
> > 
> > What would I do next ?
> > 
> > jmf
> > (Pg is 7.2, rpm install, Fedora Core 3)
> 
> 7.2 is subject to index bloat for indexes where the column increase 
> monotonicly
> and old values are deleted. In the short run you will want to schedule
> regular reindexes.

Well... that seems to answer my questions. Thanks.

> 
> In the long run, you should upgrade. 7.2 is essentially without support. I
> beleive there is still a RHEL version using it that is in support, so a
> critical fix might get back ported.

I'll do that.

thanks

jmf




---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] database size grows (even after vacuum (full and analyze))....

2006-05-08 Thread Bruno Wolff III
Please keep replies copied to the list so that others can learn from and
contribute to the discussion. I don't remember where this was, but it looks
like general is probably reasonable.

On Mon, May 08, 2006 at 15:02:20 +0100,
  Joao Miguel Ferreira <[EMAIL PROTECTED]> wrote:
> Bruno and all,
> 
> > There are a couple of possibilities worth checking. One is that there aren't
> > idle transactions staying open for a long time. These would prevent vacuum
> > from removing deleted rows as these transactions could still see them.
> 
> I've checked that. No open transactions.
> 
> > Another possibility is that the FSM is too low and there isn't enough space 
> > to
> > track all of rows that can be recovered. (Vacuuming more often will also
> > reduce the needed FSM setting.)
> Didn't check this!
> 
> > A third possible issue is index bloat, which
> > can happen on older versions (7.4ish) of Postgres where key values increase 
> > (or
> > decrease) montonicly.
> 
> REINDEX(ing) the indexes causes a sudden drop in filesystem usage, but
> after a while it size gets back to the value when it dropped and still
> grwoing (sime 100 to 300 Bytes/minute).
> 
> Yes, my tables contains ever grwoing values afected by a UNIQUE
> constraint.
> 
> What would I do next ?
> 
> jmf
> (Pg is 7.2, rpm install, Fedora Core 3)

7.2 is subject to index bloat for indexes where the column increase monotonicly
and old values are deleted. In the short run you will want to schedule
regular reindexes.

In the long run, you should upgrade. 7.2 is essentially without support. I
beleive there is still a RHEL version using it that is in support, so a
critical fix might get back ported.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] Google Summer of Code: Full Disjunctions

2006-05-08 Thread Tzahi Fadida
Hi Lee, 
First, i have no knowledge of anyone that have implemented full 
disjunctions(ever) aside
from the theoretical works of my colleagues.
With the exception of a corner case of it, that I believe was a simulation in 
96.
(A. Rajaman and J.D. Ullman Integrating information by outerjoins and 
full-disjunctions).
I'd love to hear about any implementation out there (aside from my colleagues 
work, which
is mine also: cohen,sagiv, kimelfeld,kanza)

It can never be a binary operation since at the heart of the matter is that you 
need to take
each subset of the relations and join them. i.e.:
A
B
C
A,B
A,C
B,C
A,B,C

and remove subsumptions, for example if you have {t_A,t_B} from the A,B join,
you will not include just {t_A} or just {t_B} in the result (subsumption).

Usually binary operations allow for a bottom up computation approach, but FD is 
a TOP down approach
(Galindo-Legaria, C. outerjoins as disjunctions).

The answer what to do is a bit complex and part of it is in a paper that is 
currently in review,
however:

You take the cyclic component, for example FD(A,B,C,D) and then join it with 
another relation E.
It's not a trouble to write (A fd B) fd C but it will still have to be computed 
as one computation -
FD(A,B,C).

Again, note that FD is only useful for cases you can't use natural outer joins.
So only if you have a cycle you use FD.

In my current implementation I do getfdr(A,B,C) to get the RECORD since with FD 
you cannot
know in advance what will be the eventual RECORD (unless you save the RECORD 
type for A,B,C
and A,B,C,D etc...)

then I run, for example, FD('A,B,C') as RECORD (a0 int, )
As you can see, you can now join other relations to the result, it's a standard 
recordset.
So (FD('A,B,C') as RECORD (a0 int, ))

Here is an example of a RUN (ignore all the additional parameters):
select getfdr('rand_1_0,rand_1_1,rand_1_2');
  getfdr   
---
 (a0 int4,a1 int4,a2 int4)
(1 row)
select * from odmbfd('rand_1_0,rand_1_1,rand_1_2',true,true,100,'random',10,10) 
AS RECORD (a0 int,
a1 int, a2 int) natural full outer join rand_4_2;
  a2  |  a0  |  a1  |  a3  
--+--+--+--
1 |  | 1813 | 
1 |  | 3091 | 
1 |  |  316 | 
2 | 2113 |  | 2738
3 |  | 2924 |  823
3 |  | 2924 | 2735
.
.

select count(*) from 
odmbfd('rand_1_0,rand_1_1,rand_1_2',true,true,100,'random',10,10) AS RECORD (a0
int, a1 int, a2 int) natural full outer join rand_4_2;
 count 
---
  3201
(1 row)

>Hi Tzahi
>
>Since you seem to know about full disjunctions, I was wondering if you
>could answer this question:
>
>Can full disjunction be implemented as a binary operator?
>
>The algorithms I've seen for computing it seem to require that all
>input relations be supplied at once. Even in your message above you
>specified your example as FD(A,B,C) rather than say (A fd B) fd C.
>So I was wondering if the latter is possible?
>
>The reason I ask is that I'm currently trying to solve a problem that
>could in principle be solved using FD but it would fit into my current
>framework much better if it were a binary operator like the other
>joins.
>
>Thanks in advance.
>Lee



---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] catalog is missing 16 attribute(s) for relid 8202590

2006-05-08 Thread Tom Lane
"Chun Yit\(Chronos\)" <[EMAIL PROTECTED]> writes:
> what i did is i=20
> 1) kill -9 (postmaster process id).
> 2) remove the postmaster.pid file under /usr/local/pgsql/data/
> 3) restart the postmaster process.

The *first* thing you ought to do is learn not to do that.  You
deliberately broke the safety interlocks that keep two separate sets of
backends from being active in a single database.  If there's corrupted
data in there now, I think it's your own fault.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] simple md5 authentication problems

2006-05-08 Thread kmh496
> > >
> > > # "local" is for Unix domain socket connections only
> > > local   all all   ident sameuser
> > > # IPv4 local connections:
> > > hostall all 127.0.0.1/32  md5
> > > # IPv6 local connections:
> > > hostall all ::1/128   ident sameuser
> > >
> > > I created my db as:
> > > postgres=# CREATE DATABASE maragato_test OWNER postgres;
> > >
> > > I seem to have a user 'postgres' - I'm using the default.
> > >
> > > postgres=# SELECT * FROM "pg_user";
> > >  usename  | usesysid | usecreatedb | usesuper | usecatupd |  passwd  |
> > > valuntil | useconfig
> > > --+--+-+--+---+--+--+---
> > >  postgres |   10 | t   | t| t |  |
> > > |
> > >
> > > However, I get this error:
> > >
> > > /home/postgres> psql -h localhost maragato_test postgres
> > > Password for user postgres:
> > > psql: FATAL:  autenticação do tipo password falhou para usuário
> > > "postgres"
> > >
doesn't that user have to exist since you are using ident method?  that
means unix username == postgres username.
do you have a user named maragato_test on the system?  
did you create that user in postgres and on the system?






---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[GENERAL] DBD::Pg 1.49 released

2006-05-08 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Version 1.49 of DBD::Pg has been released. This version adds support
for the ParamTypes statment handle attribute, and fixes a small bug in
ParamValues. It strips the final newline (as it did before) from error
messages, so that Perl's die will report the line number of the error.
It fixes an error that was causing $dbh->state() to not get set properly
in some edge cases. Finally, it adds the ability to quote and bind
the geometric types POINT, LINE, LSEG, BOX, PATH, POLYGON, and CIRCLE.

CPAN location:
  
http://search.cpan.org/~dbdpg/DBD-Pg-1.49/
  
MD5 checksum:
76b9d6a2f4cbaefcba23380f83998215  DBD-Pg-1.49.tar.gz
SHA1 checksum:
37c1c37a02afa00d48f8dd739d5d8502a7c40045  DBD-Pg-1.49.tar.gz

Remember to do a cpansign -v before you run the Makefile.PL
(see Module::Signature for more info)

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200605071601
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iD8DBQFEX0R+vJuQZxSWSsgRAuJHAJ9tEIe4bI5KZdRiLm8g4Bb7LeqauQCeMzCH
Km5QdAVDQiJ190rEy50nnVg=
=3RHI
-END PGP SIGNATURE-



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[GENERAL] how to debug

2006-05-08 Thread N Srinivasa

hi

i down loaded the postgre sql source code and compile it, can any body
plz tell that how to debug it in windows platform

regards
srinivasa

_
NRIs Zero balance Account. FREE Money Transfers with FREE DVD 
https://www.online.citibank.co.in/portal/rca_msntagofline.htm



---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] simple md5 authentication problems

2006-05-08 Thread robert
Thanks for the response, but changing to 127.0.0.1 didn't help.

Changing this line sets the db wide open:

hostall all 127.0.0.1/32  trust

>From there, another non-root login can access it with any user /
password.

What I really need is this command to work with a non-root
account, with only the right username and password - in this case the
pre-configured postgres account:

psql -U postgres -h 127.0.0.1

robert

"chris smith" escreveu:

> On 5 May 2006 02:22:32 -0700, robert <[EMAIL PROTECTED]> wrote:
> > Hi all, hope this is the right list.
> >
> > I have postgres 8.1 running on linux. We have tests that mostly run on
> > windows. I want to run these tests on linux.
> >
> > On these windows boxes, pg_hba.conf has just one line:
> >
> > hostall all 127.0.0.1/32  md5
> >
> > They use 'postgres' as the user and password to connect to a db.
> >
> > I couldn't start postgres on linux with just that line, so on linux I
> > have:
> >
> > # "local" is for Unix domain socket connections only
> > local   all all   ident sameuser
> > # IPv4 local connections:
> > hostall all 127.0.0.1/32  md5
> > # IPv6 local connections:
> > hostall all ::1/128   ident sameuser
> >
> > I created my db as:
> > postgres=# CREATE DATABASE maragato_test OWNER postgres;
> >
> > I seem to have a user 'postgres' - I'm using the default.
> >
> > postgres=# SELECT * FROM "pg_user";
> >  usename  | usesysid | usecreatedb | usesuper | usecatupd |  passwd  |
> > valuntil | useconfig
> > --+--+-+--+---+--+--+---
> >  postgres |   10 | t   | t| t |  |
> > |
> >
> > However, I get this error:
> >
> > /home/postgres> psql -h localhost maragato_test postgres
> > Password for user postgres:
> > psql: FATAL:  autenticação do tipo password falhou para usuário
> > "postgres"
> >
> > Sorry - couldn't get local en_US working. That translates to:
> > Authentication of type password failed for user postgres. I think that
> > means 'ident password' . I tried to connect with java and I get the
> > same error.
> >
> > I just need to connect to db 'maragato_test' on local host using
> > 'postgres´ as the user and password, using md5.
>
> Try '-h 127.0.0.1' rather than 'localhost' - it's still seeing the
> connection as coming through the socket, not through tcpip, so it's
> matching the "ident" rule.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> ---(end of broadcast)---
> TIP 3: Have you checked our extensive FAQ?
> 
>http://www.postgresql.org/docs/faq


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[GENERAL] recuperar el nro del registro actualizado utilizando Ado

2006-05-08 Thread Oscar Arca








 

 

Estoy programando en vb utilizo ado para conectarme 
a la bd postgre, lo
q necesito hacer es

Grabar un registro y una vez grabado recuperar el autonumerico para grabarlo en otra tabla

 

Utilizando dao con mdb lo hacia asi:

 

Rs.update

Rs.movelast

Variable = Rs(“campo”)

 

Y ya estaba.

Pero ahora se me complico.

 

Desde ya muchas gracias








Re: [GENERAL] Google Summer of Code: Full Disjunctions

2006-05-08 Thread ana_cata_hylo
Hi Tzahi

Since you seem to know about full disjunctions, I was wondering if you
could answer this question:

Can full disjunction be implemented as a binary operator?

The algorithms I've seen for computing it seem to require that all
input relations be supplied at once. Even in your message above you
specified your example as FD(A,B,C) rather than say (A fd B) fd C.
So I was wondering if the latter is possible?

The reason I ask is that I'm currently trying to solve a problem that
could in principle be solved using FD but it would fit into my current
framework much better if it were a binary operator like the other
joins.

Thanks in advance.
Lee


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] Database limits

2006-05-08 Thread A. Kretschmer
am  08.05.2006, um 13:14:26 +0200 mailte Q Beukes folgendes:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Hey,
> 
> What ways are there to limit the sizes of a database?

You can use filesystem-quotas for your data-partition and/or you can ask
the information_schema about the size of your tables and so.
http://www.postgresql.org/docs/8.1/interactive/functions-admin.html


HTH, Andreas
-- 
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz:  035242/47215,  D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===Schollglas Unternehmensgruppe=== 

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[GENERAL] Database limits

2006-05-08 Thread Q Beukes
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,

What ways are there to limit the sizes of a database?

Thx
Q Beukes


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBRF8oErEDZDQ16UzTAQJbsAf+L8+RijP+DFuVWwlHoVRCM5rmCGXo6bsi
dRoeCA3TYgJp25CIPKUXhuL5yBcXUWw5RofNMFeqQyd7n9hIjAiD8VoWxrUGOuIt
cfFH+zdvQAojMoprpEqrt3yx9U0A8pE8l+7Xld+hPJepOzTBOYnf+sna1U4ur+wj
8zPZmoJQrCmGtGzDUtpGn/h42wtlrmoRFLj0rVYRbG1u7wy/l542Qgi7SNXBydYI
jKi5bsriqYGQlcNK83va5ZRuNtmckt22eOdThPUaOjcSewyGW07zK27qBcEjUDUS
TZXEJBGVCq4ybF/OnTcFg98uSsbfYXLzY/+glOXtRPExjLdCgQAPxA==
=6zs+
-END PGP SIGNATURE-

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[GENERAL] catalog is missing 16 attribute(s) for relid 8202590

2006-05-08 Thread Chun Yit\(Chronos\)



hello, i found this ERROR msg at our postgresql log 
file at one of my client.
 
what i did is i 
1) kill -9 (postmaster process id).
2) remove the postmaster.pid file under 
/usr/local/pgsql/data/
3) restart the postmaster process.
then no more error msg in the postgresql log 
file.
 
problem come back few day later cause when i check 
the log file this morning, i saw the msg again.
 
the error msg will come out when we try to read 
record from the temporary table that created before.
 
so, i suspect the relid is refer to temporary 
table.(relation id), right?
 
what i did just restart the postmaster process 
should not be enough to solve the problem.. can 
someone give some advise on how to solve this problem?
 
Client Server Configuration
Postgresql 7.4.5 version.
Red Hat enterprise server 3.0 
version
RAM 512MB
Dell PowerEdge 1800.
 
Regards
 
Beh
 


[GENERAL] dumb but existential question

2006-05-08 Thread Jean-Yves F. Barbier

Hi list,


I plan to write an ERP program using Postgresql (with embedded
procédures) & Tcl/Tk for the GUI.

My question is: how can I recover each column value from an
embedded procedure that return a RECORD type?

Thanks in advance,


Jean-Yves

---(end of broadcast)---
TIP 6: explain analyze is your friend