Re: [GENERAL] Add a NOT NULL column with default only during add

2013-08-02 Thread Boszormenyi Zoltan
2013-08-02 16:58 keltezéssel, Tom Lane írta: Adrian Klaver writes: No I am saying that in the ALTER data_type case the column is not being created and USING is working on data(assuming data had actually been entered already) that exists. What you propose is a two step process, create a column a

Re: [GENERAL] Dump file created with pg_dump cannot be restored with psql

2013-08-02 Thread tot-to
Oh, sorry. I mixed up dumps... I am migrating from mysql and by mistake I tried to apply dump from "mysqldump --compat=postgresql" that was named very similar to dump of finally converted database produced by pg_dump (for the purpose of copy from test to main server). Bash comletitions and then

Re: [GENERAL] Dump file created with pg_dump cannot be restored with psql

2013-08-02 Thread Adrian Klaver
On 08/02/2013 05:03 PM, tot-to wrote: I have two installation of postgresql-server-9.2.4 on Gentoo. I try to just copy database from one to another. According to the documentation http://www.postgresql.org/docs/9.2/static/backup-dump.html I created dump file: psql -U > dumpfile.sql I would

[GENERAL] Dump file created with pg_dump cannot be restored with psql

2013-08-02 Thread tot-to
I have two installation of postgresql-server-9.2.4 on Gentoo. I try to just copy database from one to another. According to the documentation http://www.postgresql.org/docs/9.2/static/backup-dump.html I created dump file: psql -U > dumpfile.sql copied it to another machine, manually created t

Re: [GENERAL] Re: Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!! (nearly fixed)

2013-08-02 Thread BladeOfLight16
On Fri, Aug 2, 2013 at 10:18 AM, Adrian Klaver wrote: > You can't do that and have it work. \base is just part of the puzzle, you > need the complete \data directory for Postgres to work. > > The problem(as stated before) is you have two distinct installations of > the Postgres data directory, one

Re: [GENERAL] Strange behavior of "grant temp on schema"

2013-08-02 Thread Andrew G. Saushkin
I apologize for my carelessness. Error rollback code including all completed "revoke". Therefore, users can create functions. If you add another commit before "grant temp on schema public to sec_privilege;" it will be seen that create a function is also not possible. 14 15 create database

[GENERAL] Strange behavior of "grant temp on schema"

2013-08-02 Thread Andrew G. Saushkin
Hello! Please help to understand why the line 35 ("grant temp on schema public to sec_privilege") generates an error "ERROR: invalid privilege type TEMP for schema" and successfully created function "readonly" at the end of listing, but if it is removed, the function in lines 45-49 will not

Re: [GENERAL] demystifying nested loop vs. merge join query plan choice

2013-08-02 Thread Jeff Janes
On Thu, Aug 1, 2013 at 4:50 PM, BladeOfLight16 wrote: > On Thu, Aug 1, 2013 at 10:25 AM, Sandeep Gupta > wrote: >> >> @Jeff : Thanks for pointing this out. Turns out that was the case. >> >> @Tom: Thank you for the reference to random_page_cost parameters. It would >> be very useful for us. Would

Re: [GENERAL] Understanding database schemas

2013-08-02 Thread Melvin Call
On Fri, Aug 2, 2013 at 1:36 PM, Bosco Rama wrote: > On 08/02/13 10:56, Melvin Call wrote: > > > > If I may pigtail another related question, what is the procedure for > > allowing another user access to that schema? > > Heh. You almost have the words already: >grant usage on schema hrschema

Re: [GENERAL] Understanding database schemas

2013-08-02 Thread Bosco Rama
On 08/02/13 10:56, Melvin Call wrote: > > If I may pigtail another related question, what is the procedure for > allowing another user access to that schema? Heh. You almost have the words already: grant usage on schema hrschema to hr_user; This will allow them to see the objects in the sche

Re: [GENERAL] TOC errors

2013-08-02 Thread Jerry Sievers
Perry Smith writes: > I am doing a restore: > > pg_restore --no-owner -L /tmp/db.list --single-transaction > --dbname=condor3_production $DBFILE > > and I get this error: > > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 2056; 0 35202

[GENERAL] xlog min recovery request ... is past current point ...

2013-08-02 Thread Alberto Bussolin
Hi, i was testing a point in time recovery on a postgres 9.1.9. When processing the xlog i found out these log messages (on postgres.log): postgres@postgres[[local]] FATAL: the database system is starting up @[] LOG: restored log file "0002026B00D5" from archive @[] LOG: redo st

Re: [GENERAL] TOC errors

2013-08-02 Thread Alvaro Herrera
Perry Smith escribió: > On Aug 2, 2013, at 12:29 PM, Perry Smith wrote: > > I've used the custom format. The error tells me a line number but I > > can't look at it. Is there a way that I can convert the custom > > format to something I can view? Sure, pg_restore can save its output to a file

Re: [GENERAL] TOC errors

2013-08-02 Thread Perry Smith
On Aug 2, 2013, at 12:29 PM, Perry Smith wrote: > I am doing a restore: > > pg_restore --no-owner -L /tmp/db.list --single-transaction > --dbname=condor3_production $DBFILE > > and I get this error: > > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Err

Re: [GENERAL] Understanding database schemas

2013-08-02 Thread Melvin Call
On Fri, Aug 2, 2013 at 12:56 PM, Melvin Call wrote: > On Fri, Aug 2, 2013 at 11:56 AM, Bosco Rama wrote: > >> On 08/02/13 09:33, Melvin Call wrote: >> > >> > $ psql -U postgres >> > >> > DROP SCHEMA IF EXISTS hrschema CASCADE; >> > DROP DATABASE IF EXISTS personnel; >> > DROP USER IF EXISTS hr_adm

Re: [GENERAL] Understanding database schemas

2013-08-02 Thread Melvin Call
On Fri, Aug 2, 2013 at 11:56 AM, Bosco Rama wrote: > On 08/02/13 09:33, Melvin Call wrote: > > > > $ psql -U postgres > > > > DROP SCHEMA IF EXISTS hrschema CASCADE; > > DROP DATABASE IF EXISTS personnel; > > DROP USER IF EXISTS hr_admin; > > > > CREATE USER hr_admin > >WITH CREATEDB > >P

Re: [GENERAL] Identify primary key in simple/updatable view

2013-08-02 Thread Richard Broersma
MS-Access lets the user specify which column is the Primary Key to avoid this introspection. On Fri, Aug 2, 2013 at 8:18 AM, Lionel Elie Mamane wrote: > Now that PostgreSQL has updatable views, users (of LibreOffice / > native PostgreSQL drivers) want to use them... LibreOffice needs a > primar

Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!! (nearly fixed)

2013-08-02 Thread George Weaver
- Original Message - From: Stephen Brearley Having been able to successfully connect to Postgres using both Navicat and pgAdmin, I then moved my \data_old back to the \9.2 folder on the D: drive, and modified the registry reference to point to this location..however I can't see my o

Re: [GENERAL] Identify primary key in simple/updatable view

2013-08-02 Thread Andrew Tipton
On Fri, Aug 2, 2013 at 11:18 PM, Lionel Elie Mamane wrote: > Now that PostgreSQL has updatable views, users (of LibreOffice / > native PostgreSQL drivers) want to use them... LibreOffice needs a > primary key to "locate" updates (that is, construct the WHERE clause > of an UPDATE or DELETE). > > [

[GENERAL] TOC errors

2013-08-02 Thread Perry Smith
I am doing a restore: pg_restore --no-owner -L /tmp/db.list --single-transaction --dbname=condor3_production $DBFILE and I get this error: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 2056; 0 35202 TABLE DATA adv_ptf_release_maps pedz

Re: [GENERAL] Understanding database schemas

2013-08-02 Thread Bosco Rama
On 08/02/13 09:33, Melvin Call wrote: > > $ psql -U postgres > > DROP SCHEMA IF EXISTS hrschema CASCADE; > DROP DATABASE IF EXISTS personnel; > DROP USER IF EXISTS hr_admin; > > CREATE USER hr_admin >WITH CREATEDB >PASSWORD 'md5be394806d6a21c6c52aa2b76063c7d9d'; > > DROP DATABASE IF EXI

Re: [GENERAL] incremental dumps

2013-08-02 Thread hamann . w
>> On 08/01/2013 02:59 AM, haman...@t-online.de wrote: >> > >> > However, the diff files seem to be considerably larger than one would >> > expect. >> > One obvious part of the problem is the fact that diff shows old and new >> > text, >> >> You could try using >> diff --suppress-common-line

[GENERAL] Understanding database schemas

2013-08-02 Thread Melvin Call
Good morning all, I am trying to get a better understanding of how schemas can be used to limit access to objects, and I seem to be failing miserably. Can anyone point me to documentation about, or a decent tutorial on, schema usage for access separation? I have tried to understand through the use

Re: [GENERAL] Fastest Index/Algorithm to find similar sentences

2013-08-02 Thread Kevin Grittner
Janek Sendrowski wrote: > I also tried pg_trgm module, which works with tri-grams, but it's > also very slow with 100.000+ rows. Hmm.  I found the pg_trgm module very fast for name searches with millions of rows *as long as I used KNN-GiST techniques*.  Were you careful to do so?  Check out the

[GENERAL] Identify primary key in simple/updatable view

2013-08-02 Thread Lionel Elie Mamane
Now that PostgreSQL has updatable views, users (of LibreOffice / native PostgreSQL drivers) want to use them... LibreOffice needs a primary key to "locate" updates (that is, construct the WHERE clause of an UPDATE or DELETE). How can the driver automatically identify the view columns that correspo

Re: [GENERAL] Add a NOT NULL column with default only during add

2013-08-02 Thread Tom Lane
Adrian Klaver writes: > No I am saying that in the ALTER data_type case the column is not being > created and USING is working on data(assuming data had actually been > entered already) that exists. What you propose is a two step process, > create a column and then fill it with a default value

Re: [GENERAL] How to do incremental / differential backup every hour in Postgres 9.1?

2013-08-02 Thread Kevin Grittner
Jeff Janes wrote: > Neil McGuigan wrote: >> Trying to do an hourly hot incremental backup of a single postgres server >> (windows). > > Can you explain what "incremental backup" means to you?  I find that > there is a surprising variety of opinions about what these terms mean. > To me, the accumu

[GENERAL] Re: Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!! (nearly fixed)

2013-08-02 Thread Adrian Klaver
On 08/02/2013 02:40 AM, Stephen Brearley wrote: Hi Folks (hope I haven’t left anyone out) SUCCESS (ALMOST)!! >>I’ve managed to re-install Postgres **without any install errors** and >>I’ve managed to login **without any connection errors** But..I’m not 100% sure how I did it and.. >>I can

Re: [GENERAL] incremental dumps

2013-08-02 Thread Martin Collins
On 08/01/2013 02:59 AM, haman...@t-online.de wrote: > > However, the diff files seem to be considerably larger than one would expect. > One obvious part of the problem is the fact that diff shows old and new text, You could try using diff --suppress-common-lines -ed which in my experience create

Re: [GENERAL] Add a NOT NULL column with default only during add

2013-08-02 Thread Adrian Klaver
On 08/02/2013 01:03 AM, BladeOfLight16 wrote: On Thu, Aug 1, 2013 at 8:15 PM, Adrian Klaver mailto:adrian.kla...@gmail.com>> wrote: What you want is a default that only works during ALTER ADD COLUMN. At that point though, there is no data added and DEFAULT only works with INSERTS. Yo

Re: [GENERAL] Why are stored procedures looked on so negatively?

2013-08-02 Thread Merlin Moncure
On Fri, Aug 2, 2013 at 1:49 AM, Chris Travers wrote: > Here's my $0.02 > > Stored procedures have a bunch of problems historically. Part of this is > because the interface traditionally is pretty spartan, and partly because > some people take them too far. > > The first issue is that if you have

[GENERAL] Installing 9.2 on Ubuntu from packages: what is the current recommendation?

2013-08-02 Thread Tim Bowden
Normally I install from source and create dummy packages as needed to satisfy dependencies, however I had an attack of the cbf's and decided to go looking for packages for Ubuntu 13.04 raring. I discovered apt.postgresql.org only does LTS releases. Is this the long term plan, or will intermediate

Re: [GENERAL] postgres FDW cost estimation options unrecognized in 9.3-beta1

2013-08-02 Thread BladeOfLight16
On Fri, Jul 26, 2013 at 6:28 PM, Tom Lane wrote: > > > I think we could do with both more documentation, and better error > messages for these cases. In the SET-where-you-should-use-ADD case, > perhaps > > ERROR: option "use_remote_estimate" has not been set > HINT: Use ADD not SET to define a

Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!!

2013-08-02 Thread Alban Hertroys
On Aug 1, 2013, at 11:27, Stephen Brearley wrote: > Hi Alban > > Think we are making progress.. > > I'll need to do some research to understand how to find the event log, but > to answer your other points: > > 1) Glad to see you think the database started up correctly. I also noted > this pro

[GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!! (nearly fixed)

2013-08-02 Thread Stephen Brearley
Hi Folks (hope I haven't left anyone out) SUCCESS (ALMOST)!! >>I've managed to re-install Postgres *without any install errors* and >>I've managed to login *without any connection errors* But..I'm not 100% sure how I did it and.. >>I can't access my table data I think I got Postgr

Re: [GENERAL] Recovery_target_time misinterpreted?

2013-08-02 Thread Klaus Ita
No, it's super frustrating. While I do the recovery, it says it reaches a consistent recovery state, and i just cannot find a way how to convince pg to stop at that state: 2013-08-02 09:23:25 GMT DEBUG: postgres: PostmasterMain: initial environment dump: 2013-08-02 09:23:25 GMT DEBUG:

Re: [GENERAL] Add a NOT NULL column with default only during add

2013-08-02 Thread Vik Fearing
On 08/02/2013 10:03 AM, BladeOfLight16 wrote: > So my question is effectively this: Is there an existing, equivalent, > single DDL statement to the following hypothetical SQL? > > ALTER TABLE x > ADD COLUMN data2 VARCHAR(10) NOT NULL USING 'foo'; > > where "USING" here would indicate the same thing

Re: [GENERAL] Recovery_target_time misinterpreted?

2013-08-02 Thread Albe Laurenz
Klaus Ita wrote: >>> I have restored a Database Cluster with a recovery_target_time set to >>> >>> recovery_target_time = '2013-07-27 21:20:17.127664+00' >>> recovery_target_inclusive = false >>> >>> >>> >>> now it seems the restore rather restored to some point in time (rather the >>> 18th than

Re: [GENERAL] Add a NOT NULL column with default only during add

2013-08-02 Thread BladeOfLight16
On Thu, Aug 1, 2013 at 8:15 PM, Adrian Klaver wrote: > What you want is a default that only works during ALTER ADD COLUMN. At > that point though, there is no data added and DEFAULT only works with > INSERTS. Your example of USING with ALTER data_type works because there > actually may be rows alr