Re: [GENERAL] Understanding Schema's

2010-12-14 Thread Alban Hertroys
On 15 Dec 2010, at 3:14, Craig Ringer wrote: > It'd be nice if PostgreSQL offered more convenient ways to set an initial > schema for new connections, because for some use cases it'd be quite handy to > use a single database with many schema. Unfortunately most tools only know > how to ask for

Re: [GENERAL] Changing WAL Directory in Postgres

2010-12-14 Thread John R Pierce
On 12/14/10 10:49 PM, Adarsh Sharma wrote: Hi all, From the last 2 days I am researching on Performance Tuning in Postgres. For this , I have to change my WAL directory to other disk than the data directory. But I am not able to find the correct way to do this. instead, I would create the d

Re: [GENERAL] Need static version of libpq library

2010-12-14 Thread Magnus Hagander
On Wed, Dec 15, 2010 at 07:41, Trupti Ghate wrote: > Hi, > > Where can I find the precompiled static version of  libpq > library("libpqdll.lib")? > > Can I download it from somewhere? I don't believe we ship it, since it's dependent on the compiler version. however, it will automatically be built

[GENERAL] Changing WAL Directory in Postgres

2010-12-14 Thread Adarsh Sharma
Hi all, From the last 2 days I am researching on Performance Tuning in Postgres. For this , I have to change my WAL directory to other disk than the data directory. But I am not able to find the correct way to do this. Please be kind to advice. Thanks & Regards Adarsh Sharma -- Sent via p

[GENERAL] Need static version of libpq library

2010-12-14 Thread Trupti Ghate
Hi, Where can I find the precompiled static version of libpq library("libpqdll.lib")? Can I download it from somewhere? Thanks, Trupti

Re: [GENERAL] create language 'plpythonu' on win failed

2010-12-14 Thread MICHÁLEK Jan Mgr .
I'm superuser. I have the same problem on both mz computers, on PC with win xp and on ntb with win 7. Both postgresql is 9.0 and on both I have python 27. Je. -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Tuesday, December 14, 2010 4:09 PM To: pgsql-gene

Re: [GENERAL] how to vacuum from standalone backend

2010-12-14 Thread Scott Marlowe
On Tue, Dec 14, 2010 at 11:04 AM, Steve Clark wrote: > Help! > > This is postgresql 8.1.3 also the database debug can easily be recreated if Do you have a reason for running a version of postgresql that is missing over 2 years of security and bug fixes? The 8.1 branch is up to 8.1.22 now, I'd re

Re: [GENERAL] Changing table owner to db owner.

2010-12-14 Thread Adrian Klaver
On Tuesday 14 December 2010 5:58:16 pm Paul McGarry wrote: > On Wed, Dec 15, 2010 at 12:39 PM, Adrian Klaver wrote: > > You did not say what version you are using. In 9.0 you have this option: > > http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges > >.html > > Our servers a

Re: [GENERAL] Understanding Schema's

2010-12-14 Thread Craig Ringer
On 12/15/2010 08:08 AM, Carlos Mennens wrote: I've recently switched from MySQL& have read the documentation for 'schema's' however I guess I'm just not at that level or really daft when it comes to database design. In terms of the way they work and their operation, PostgreSQL "schemas" are i

Re: [GENERAL] Changing table owner to db owner.

2010-12-14 Thread Paul McGarry
On Wed, Dec 15, 2010 at 12:39 PM, Adrian Klaver wrote: > You did not say what version you are using. In 9.0 you have this option: > http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges.html Our servers are a mix of 8.3 and 8.4. > I generally do as superuser; > > SET ROLE us

Re: [GENERAL] Changing table owner to db owner.

2010-12-14 Thread Adrian Klaver
On Tuesday 14 December 2010 5:02:56 pm Paul McGarry wrote: > I have a number of DBs that are all the same structure but are owned > by different users and I want to add a table to each of those DBs. > > At the moment I have to either connect to each DB as it's user (which > means digging up it's pa

[GENERAL] Changing table owner to db owner.

2010-12-14 Thread Paul McGarry
I have a number of DBs that are all the same structure but are owned by different users and I want to add a table to each of those DBs. At the moment I have to either connect to each DB as it's user (which means digging up it's password) or do it as the DB super user and run an ALTER table ... OWN

Re: [GENERAL] Understanding Schema's

2010-12-14 Thread Bill Moran
On Tue, 14 Dec 2010 19:20:37 -0500 Carlos Mennens wrote: > On Tue, Dec 14, 2010 at 7:17 PM, Joshua D. Drake > wrote: > > You can cross query a schema but not a database. > > > > So you can create: > > > > create table fire.foo() > > create table ice.foo() > > > > And they are isolated from each

Re: [GENERAL] Understanding Schema's

2010-12-14 Thread Carlos Mennens
On Tue, Dec 14, 2010 at 7:17 PM, Joshua D. Drake wrote: > You can cross query a schema but not a database. > > So you can create: > > create table fire.foo() > create table ice.foo() > > And they are isolated from each other physically and logically but you > can query them both: > > SELECT fire.*

Re: [GENERAL] Understanding Schema's

2010-12-14 Thread Joshua D. Drake
On Tue, 2010-12-14 at 19:08 -0500, Carlos Mennens wrote: > I've recently switched from MySQL & have read the documentation for > 'schema's' however I guess I'm just not at that level or really daft > when it comes to database design. > > http://www.postgresql.org/docs/current/static/ddl-schemas.ht

[GENERAL] Understanding Schema's

2010-12-14 Thread Carlos Mennens
I've recently switched from MySQL & have read the documentation for 'schema's' however I guess I'm just not at that level or really daft when it comes to database design. http://www.postgresql.org/docs/current/static/ddl-schemas.html I'm trying to understand the relation between actual databases

Re: [GENERAL] Hot Standby pg_xlog problem

2010-12-14 Thread Fujii Masao
On Wed, Dec 15, 2010 at 7:24 AM, Michael Blake wrote: > I'm trying to set up a master/slave server, which initially worked > fine, but recently started failing with the following error: > > == > LOG:  database system was interrupted; last known up at [time] > LOG:  could not open file

Re: [GENERAL] Hot Standby pg_xlog problem

2010-12-14 Thread Devrim GÜNDÜZ
On Wed, 2010-12-15 at 09:24 +1100, Michael Blake wrote: > I'm trying to set up a master/slave server, which initially worked > fine, but recently started failing with the following error: > > == > LOG: database system was interrupted; last known up at [time] > LOG: could not open fil

[GENERAL] Hot Standby pg_xlog problem

2010-12-14 Thread Michael Blake
I'm trying to set up a master/slave server, which initially worked fine, but recently started failing with the following error: == LOG: database system was interrupted; last known up at [time] LOG: could not open file "pg_xlog/0001002B" (log file 0, segment 43): No su

Re: [GENERAL] Simple, free PG GUI/query tool wanted

2010-12-14 Thread Joshua D. Drake
Gnome and KDE and OpenOffice all have free simple query tools On Wed, 2010-12-15 at 11:12 +1300, Brent Wood wrote: -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering http://twitter.

[GENERAL] Problem with hot standby

2010-12-14 Thread Michael Blake
I'm trying to set up a master/slave server, which initially worked fine, but recently started failing with the following error: == LOG: database system was interrupted; last known up at [time] LOG: could not open file "pg_xlog/0001002B" (log file 0, segment 43): No su

Re: [GENERAL] Simple, free PG GUI/query tool wanted

2010-12-14 Thread Brent Wood
Hi, pgadmin is still an admin tool, NOT a simple user query tool. I'd suggest PG Access as worth a look, but unfortunately it is no longer supported, and I have never tried it with a recent version of Postgres. Brent Wood Brent Wood DBA/GIS consultant NIWA, Wellington New Zealand >>> "Elford,

Re: [GENERAL] how to vacuum from standalone backend

2010-12-14 Thread Steve Clark
On 12/14/2010 01:04 PM, Steve Clark wrote: Help! This is postgresql 8.1.3 also the database debug can easily be recreated if I have to drop it but I can't seem to do that either. vacuumdb debug vacuumdb: could not connect to database debug: FATAL: database is not accepting commands to avoi

Re: [GENERAL] range intervals in window function frames

2010-12-14 Thread Daniel Popowich
Tom Lane writes: > Daniel Popowich writes: > > Close. Your where clause needed to have (ts<=t1.ts). It can also be > > simplified to this: > > > select t1.ts, t1.value, (select avg(t2.value) > >from sample t2 > >where (t

Re: [GENERAL] range intervals in window function frames

2010-12-14 Thread Tom Lane
Daniel Popowich writes: > Close. Your where clause needed to have (ts<=t1.ts). It can also be > simplified to this: > select t1.ts, t1.value, (select avg(t2.value) >from sample t2 >where (t1.ts - t2.ts) <= interval '5 min

[GENERAL] Postgres DOD Certification Common Criteria Level

2010-12-14 Thread Eric McDonald
Greetings All: Does anyone here have any insight on to what EAL level Postgres is at for DOD/Military installations? I see that there's an SE-Linux fortified version on the Wiki, but no certifications are listed in the contents. Any direction to certifications, STIG, or otherwise would be great

Re: [GENERAL] range intervals in window function frames

2010-12-14 Thread Daniel Popowich
Vincent Veyron writes: > > What I would LIKE to do is this: > > > > select *, avg(ts) over(order by ts range (interval '5 min') preceding) > > from sample order by ts; > > > > This? > > > select t1.ts, t1.value, (select avg(t2.value) from (select value from > sample where (t1.ts-ts

Re: [GENERAL] Simple, free PG GUI/query tool wanted

2010-12-14 Thread Elford,Andrew [Ontario]
http://www.pgadmin.org/download/windows.php From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Gauthier, Dave Sent: December 14, 2010 1:38 PM To: pgsql-general@postgresql.org Subject: [GENERAL] Simple, free PG GUI/que

Re: [GENERAL] psql symbol lookup error

2010-12-14 Thread Rich Shepard
On Tue, 14 Dec 2010, Merlin Moncure wrote: you have an older version of libpq in your library path, probably in /usr/lib. Merlin, Sure enough. and it should work. It's probably not a good idea to permanently set your library path this way via the environment, google osx library path.

[GENERAL] Simple, free PG GUI/query tool wanted

2010-12-14 Thread Gauthier, Dave
Hi: I'm trying to find a simple, easy-to-use, open (free), Windows based query tool for PG. This would be something for the novice end user, a means to build a query, execute it, export results out to a csv or Excel or something like that. Tools with metadata editors are actually undesirable (

Re: [GENERAL] psql symbol lookup error

2010-12-14 Thread Merlin Moncure
On Tue, Dec 14, 2010 at 1:24 PM, Rich Shepard wrote: >  I have -9.0.1 installed in /usr/local/pgsql and my accounting software > (Ledger123) can access its data there. However, when I try to run 'psql > aesi' (the L123 database), which is owned by me, on the command line I see: > > [rshep...@salmo

[GENERAL] psql symbol lookup error

2010-12-14 Thread Rich Shepard
I have -9.0.1 installed in /usr/local/pgsql and my accounting software (Ledger123) can access its data there. However, when I try to run 'psql aesi' (the L123 database), which is owned by me, on the command line I see: [rshep...@salmo ~]$ psql aesi psql: symbol lookup error: psql: undefined sym

[GENERAL] how to vacuum from standalone backend

2010-12-14 Thread Steve Clark
Help! This is postgresql 8.1.3 also the database debug can easily be recreated if I have to drop it but I can't seem to do that either. vacuumdb debug vacuumdb: could not connect to database debug: FATAL: database is not accepting commands to avoid wraparound data loss in database "debug" H

Re: [GENERAL] queriing the version of libpq

2010-12-14 Thread Massa, Harald Armin
>> My question: Which way is available to query the linked libpq version? > But it does outline that fact that it wouldn't suck to have a >function in > libpq returning the version so that application can >check this at runtime - > clearly it would also be useful when >being linked "through" s

Re: [GENERAL] Bytea error in PostgreSQL 9.0

2010-12-14 Thread Vick Khera
On Tue, Dec 14, 2010 at 11:22 AM, tuanhoanganh wrote: > Thanks for your answer. But I don't want to change db config or ALTER > DATABASE data SET bytea_output='escape'; > I can change my app. So is there document introduce how to work with > postgresql 9 bytea Your .Net or whatever library you're

Re: [GENERAL] Bytea error in PostgreSQL 9.0

2010-12-14 Thread Francisco Figueiredo Jr.
Latest Npgsql version 2.0.11 already has a fix to handle new bytea representation. Can you try with this version and see if it works ok? I hope it helps. On Tue, Dec 14, 2010 at 14:22, tuanhoanganh wrote: > Thanks for your answer. But I don't want to change db config or ALTER > DATABASE data SE

Re: [GENERAL] Bytea error in PostgreSQL 9.0

2010-12-14 Thread Tom Lane
tuanhoanganh writes: > Thanks for your answer. But I don't want to change db config or ALTER > DATABASE data SET bytea_output='escape'; > I can change my app. So is there document introduce how to work with > postgresql 9 bytea ( I don't want to user lo_create, lo_import. lo_export) http://www.po

Re: [GENERAL] Bytea error in PostgreSQL 9.0

2010-12-14 Thread tuanhoanganh
Thanks for your answer. But I don't want to change db config or ALTER DATABASE data SET bytea_output='escape'; I can change my app. So is there document introduce how to work with postgresql 9 bytea ( I don't want to user lo_create, lo_import. lo_export) Tuan Hoang Anh On Tue, Dec 14, 2010 at 8:5

Re: [GENERAL] crosstab function

2010-12-14 Thread Sim Zacks
That did it.It's the smallest things that always kill you. Thanks Sim On 12/14/2010 05:00 PM, Filip Rembiałkowski wrote: http://www.postgresql.org/docs/8.4/interactive/tablefunc.html says: The |crosstab| function produces one output row for each consecutive group of input rows wit

Re: [GENERAL] create language 'plpythonu' on win failed

2010-12-14 Thread Adrian Klaver
On Tuesday 14 December 2010 4:28:28 am MICHÁLEK Jan Mgr. wrote: > I try instal python 26, but without changes... > > ERROR: could not load library "C:/Program > Files/PostgreSQL/9.0/lib/plpython.dll": unknown error 126 > Are the permissions correct? -- Adrian Klaver adrian.kla...@gmail.com -

Re: [GENERAL] crosstab function

2010-12-14 Thread Filip Rembiałkowski
http://www.postgresql.org/docs/8.4/interactive/tablefunc.html says: > The crosstab function produces one output row for each consecutive group > of input rows with the same row_name value. It fills the output valuecolumns, > left to right, with the > value fields from these rows. If there are fe

Re: [GENERAL] Bytea error in PostgreSQL 9.0

2010-12-14 Thread Ivan Voras
On 14/12/2010 14:51, tuanhoanganh wrote: Thanks for your help. Is there any .Net or VB tutorial new 9.0 bytea? You do not need to change your code if you add bytea_output = 'escape' # hex, escape into postgresql.conf. -- Sent via pgsql-general mailing list (pgsql-general@po

Re: [GENERAL] Bytea error in PostgreSQL 9.0

2010-12-14 Thread tuanhoanganh
Thanks for your help. Is there any .Net or VB tutorial new 9.0 bytea? Tuan Hoang Anh On Tue, Dec 14, 2010 at 1:27 PM, Mark Felder wrote: > On Mon, 13 Dec 2010 23:06:32 -0600, tuanhoanganh > wrote: > > I have program work with bytea, this field store image. Program work well >> in >> postgresq

Re: [GENERAL] crosstab function

2010-12-14 Thread Sim Zacks
Just to clarify, there aren't duplicate rows. But if the customer purchased two products there are 2 rows for that customer, one with the quantity sum filled in for the first product and the second row with the quantity sum filled in for the second product. I want one customer row with all the

Re: [GENERAL] create language 'plpythonu' on win failed

2010-12-14 Thread MICHÁLEK Jan Mgr .
I try instal python 26, but without changes... ERROR: could not load library "C:/Program Files/PostgreSQL/9.0/lib/plpython.dll": unknown error 126 -Original Message- From: Peter Geoghegan [mailto:peter.geoghega...@gmail.com] Sent: Tuesday, December 14, 2010 12:40 PM To: MICHÁLEK Jan

Re: [GENERAL] crosstab function

2010-12-14 Thread Sim Zacks
I rechecked and with products as columns it has duplicate customers. My goal is one row per customer with the sum of quantity filled in for each product they purchased. create table customers(customerid serial primary key, customername text); create table products(productid serial primary key,

[GENERAL] Best GPLike ERD/SQL developing tool for postgresql?

2010-12-14 Thread Wim Bertels
Hallo, i have tested some tools, but none of them have the all the functionality i'm looking for: (erd/sql(/db)) - forward engineer SQL (to db (and uncluttered erd)) - backward engineer SQL (to sql and uncluttered erd) - compare - autocompletion when writing code (erd) - full postgresql suppo

Re: [GENERAL] create language 'plpythonu' on win failed

2010-12-14 Thread Peter Geoghegan
Just use the python 2.6 installer for windows. -- Regards, Peter Geoghegan -- 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] range intervals in window function frames

2010-12-14 Thread Vincent Veyron
[sent you a personal email by mistake - slightly corrected query posted to the list] Le dimanche 12 décembre 2010 à 10:55 -0500, Daniel Popowich a écrit : > Hello all! > > I need to do moving averages over time series data and was hoping > window functions could solve the problem for me, but it d

[GENERAL] create language 'plpythonu' on win failed

2010-12-14 Thread MICHÁLEK Jan Mgr .
I can't solve problem with creating language python in my POSTGRESQL (9.0) - create language 'plpythonu' ERROR: could not load library "C:/Program Files/PostgreSQL/9.0/lib/plpython.dll": unknown error 126 --

Re: [GENERAL] Recreate C functions?

2010-12-14 Thread Pavel Stehule
2010/12/14 Elliot Chance : > OK, my fault, in the docs: > "After it is used for the first time, a dynamically loaded object file is > retained in memory. Future calls in the same session to the function(s) in > that file will only incur the small overhead of a symbol table lookup. If > you need to

Re: [GENERAL] Recreate C functions?

2010-12-14 Thread Elliot Chance
OK, my fault, in the docs: "After it is used for the first time, a dynamically loaded object file is retained in memory. Future calls in the same session to the function(s) in that file will only incur the small overhead of a symbol table lookup. If you need to force a reload of an object file,

Fwd: [GENERAL] Recreate C functions?

2010-12-14 Thread Elliot Chance
> Hello > > it's maybe offtopic - you use a deprecated API > > better to use V1 interface. I'll keep that in mind - I'm just playing with the sourse code right now. Restarting the whole server every time I make one tiny change is not a viable option. Surely theres a way to tell it to refresh o

Re: [GENERAL] Recreate C functions?

2010-12-14 Thread Pavel Stehule
Hello it's maybe offtopic - you use a deprecated API better to use V1 interface. Regards Pavel Stehule 2010/12/14 Elliot Chance : > Hi, > > I seem to be having trouble recreating C functions, the source: > > === test.c > #include > #include > > PG_MODULE_MAGIC; > > int32 plpgsql_test(te

Re: [GENERAL] Recreate C functions?

2010-12-14 Thread Pavel Stehule
2010/12/14 Elliot Chance : > Hi, > > I seem to be having trouble recreating C functions, the source: > > === test.c > #include > #include > > PG_MODULE_MAGIC; > > int32 plpgsql_test(text* s) { >    return 100; > } > === end === > > Then compile: > $ cc -fpic -c -I/usr/include/pgsql/server te

[GENERAL] Recreate C functions?

2010-12-14 Thread Elliot Chance
Hi, I seem to be having trouble recreating C functions, the source: === test.c #include #include PG_MODULE_MAGIC; int32 plpgsql_test(text* s) { return 100; } === end === Then compile: $ cc -fpic -c -I/usr/include/pgsql/server test.c $ ld -shared -o funcs.so test.o Then create the f

Re: [GENERAL] crosstab function

2010-12-14 Thread Filip Rembiałkowski
please show - source data structures (in form of CREATE TABLE please) - actual whole query that creates duplicates 2010/12/14 Sim Zacks > postgres 8.2.17 > > I am trying out the crosstab function (tablefunc contrib) for reporting > needs and I'm having a problem. > I have customers and pro