[GENERAL] DELETE with LIMIT - workaround?

2013-06-27 Thread Chris Angelico
because it does make good sense to do this in a single pass rather than fetching some kind of unique identifier and then re-locating by that. But is the ctid somehow magical in being actually fast/simple enough to not care about the difference? Chris Angelico -- Sent via pgsql-general mailing

Re: [GENERAL] coalesce function

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 7:36 AM, David Johnston pol...@yahoo.com wrote: SELECT input FROM ( SELECT unnest($1) AS input ) src WHERE input IS NOT NULL AND input '' LIMIT 1; Does this guarantee the order of the results returned? Using LIMIT without ORDER BY is

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:10 AM, Amit Langote amitlangot...@gmail.com wrote: If this particular function is to be used repeatedly in a single query, would the cost of having a wrapper function around the original function be too large? For example, if this function appears in a WHERE clause

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:35 AM, Amit Langote amitlangot...@gmail.com wrote: On Thu, Jun 20, 2013 at 10:27 AM, Chris Angelico ros...@gmail.com wrote: If your wrapper function is written in SQL and is trivial (eg ignore the third parameter and pass the other two on), the planner should be able

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote amitlangot...@gmail.com wrote: Umm, my bad! I almost forgot I could write pure SQL function bodies. Although, why does following happen? (sorry, a 8.4.2 installation) : postgres=# create or replace function gt(n int, m int) returns boolean as

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 12:34 PM, Amit Langote amitlangot...@gmail.com wrote: On Thu, Jun 20, 2013 at 11:10 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote amitlangot...@gmail.com wrote: Umm, my bad! I almost forgot I could write pure SQL function

Re: [GENERAL] Using a CTE for an update

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 7:37 AM, David Salisbury salisb...@globe.gov wrote: I would think this would be possible. I'm on 9.0.8 I have a reference between two tables, and want to populate a field in one table with a value that's in the referenced table ( based on the FK reference of course

Re: [GENERAL] Introduction

2013-05-30 Thread Chris Angelico
On Thu, May 30, 2013 at 6:02 AM, Corbett, James james.corb...@cra-arc.gc.ca wrote: For those twenty years as a developer I should say that I have been completely blind, relying upon a screen review application known as JAWS and a Braille display. I’m looking forward to being part of this

Re: [GENERAL] Success stories of PostgreSQL implementations in different companies

2013-05-24 Thread Chris Angelico
On Fri, May 24, 2013 at 11:52 PM, ocalde...@solucionesaplicativas.com wrote: Thank you all of you for your answers! It helps me a lot because when I'm trying to convince a client to migrate to PostgreSQL sometimes they think that because it's free, it only works for small databases for web

Re: [GENERAL] Success stories of PostgreSQL implementations in different companies

2013-05-24 Thread Chris Angelico
On Sat, May 25, 2013 at 12:56 AM, Scott Marlowe scott.marl...@gmail.com wrote: In addition to the other places mentioned, don't forget that the .info and .org TLDs run on pgsql. and run quite well too. Oracle tossed a LOT of FUD when Afilias put in their bid to run the TLD on postgresql. It

Re: [GENERAL] Storing Special Characters

2013-05-14 Thread Chris Angelico
On Wed, May 15, 2013 at 8:20 AM, CR Lender crlen...@gmail.com wrote: On 2013-05-14 19:32, Paul Jungwirth wrote: The UTF-8 encoding for a pound sign is 0xc2a3, not just 0xa3. You might want to make sure your PHP file is correct. Just for the record, the Unicode code point for the pound symbol

Re: [GENERAL] FATAL: database a/system_data does not exist

2013-05-10 Thread Chris Angelico
On Fri, May 10, 2013 at 5:13 PM, sumita su...@avaya.com wrote: This error is getting logged at an interval of 2 minutes and 10 seconds 2013-05-10 00:22:50 GMT:[4180]FATAL: database a/system_data does not exist 2013-05-10 00:25:00 GMT:[4657]FATAL: database a/system_data does not exist

Re: [GENERAL] What's wrong with postgresql.org domain?

2013-04-18 Thread Chris Angelico
On Thu, Apr 18, 2013 at 6:33 PM, Magnus Hagander mag...@hagander.net wrote: On Thu, Apr 18, 2013 at 10:31 AM, Eduardo Morras emorr...@yahoo.es wrote: I get Godaddy's page saying it's free Really? Whois shows it expires Oct 21 - and surely it will be renewed by then. and godaddy says it's

Re: [GENERAL] What's wrong with postgresql.org domain?

2013-04-18 Thread Chris Angelico
On Thu, Apr 18, 2013 at 8:32 PM, Eduardo Morrás emorr...@yahoo.es wrote: On Thu, 18 Apr 2013 18:40:40 +1000 Chris Angelico ros...@gmail.com wrote: Works for me. Do a name lookup - what IP address do you get? I get: postgresql.org. 17973 IN A 217.196.149.50

Re: [GENERAL] procedure to contribute this community

2013-04-07 Thread Chris Angelico
On Mon, Apr 8, 2013 at 4:14 AM, Gavin Flower gavinflo...@archidevsys.co.nz wrote: Not to mention that it appears that Postgres runs better on Linux than on Microsoft. Linux skills are increasingly in demand, while MIcrosoft's market share is dropping (partly as a result of the Metro fiasco!).

Re: [GENERAL] procedure to contribute this community

2013-04-07 Thread Chris Angelico
On Mon, Apr 8, 2013 at 8:27 AM, Gavin Flower gavinflo...@archidevsys.co.nz wrote: On 08/04/13 09:45, Chris Angelico wrote: My development platform consists of Linux, Xfce, five workspaces... On my workstation, I use xfce with 25 virtual workspaces, 8 currently empty, I've been logged

Re: [GENERAL] Money casting too liberal?

2013-03-28 Thread Chris Angelico
On Fri, Mar 29, 2013 at 10:39 AM, Jasen Betts ja...@xnet.co.nz wrote: how confusing is 'EST' ? worse than this: set datestyle to 'sql,dmy'; set time zone 'Australia/Brisbane'; select '20130101T00Z'::timestamptz; set time zone 'Australia/Sydney'; select '20130101T00Z'::timestamptz;

Re: [GENERAL] Rewritten rows on unchanged values

2013-03-23 Thread Chris Angelico
On Sat, Mar 23, 2013 at 1:50 AM, Bertrand Janin b...@janin.com wrote: Tom is right, this would be an optimization for a corner case, I noticed this when running a generated script for a batch update that wasn't given a ton of attention. The BEFORE UPDATE trigger will work great. If you know

Re: [GENERAL] Problem in Set search path

2013-03-21 Thread Chris Angelico
On Thu, Mar 21, 2013 at 11:33 PM, Kalai R softlinne...@gmail.com wrote: Hi, I am using postgresql 9.0.3. In my application I change often schema name using set search path. Some times schema name set correctly. But some time it does not set correctly and it takes the schema previously I

Re: [GENERAL] Finding matching words in a word game

2013-03-06 Thread Chris Angelico
for a heavy database engine here, unless you're working with millions and millions of words :) Chris Angelico -- 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] Connection limit exceeded for non-superusers when there are plenty of available slots

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 7:38 AM, G B g.b.co...@gmail.com wrote: SHOW superuser_reserved_connections; 480 SHOW max_connections; 500 Is there something I'm missing here? Thanks for your help. This leaves just 20 connections for non-root users. Did you intend to set

[GENERAL] Order of granting with many waiting on one lock

2013-02-10 Thread Chris Angelico
the other eighteen? Chris Angelico -- 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] Order of granting with many waiting on one lock

2013-02-10 Thread Chris Angelico
On Mon, Feb 11, 2013 at 6:12 PM, Pavan Deolasee pavan.deola...@gmail.com wrote: * Determine where to add myself in the wait queue. * * Normally I should go at the end of the queue. Ah! That's perfect. So they'll actually go into perfect strict round-robin, assuming that there

Re: [GENERAL] DEFERRABLE NOT NULL constraint

2013-02-06 Thread Chris Angelico
On Wed, Feb 6, 2013 at 8:01 PM, Jasen Betts ja...@xnet.co.nz wrote: On 2013-02-06, Bèrto ëd Sèra berto.d.s...@gmail.com wrote: Hi You've hidden nothing from INSERT-RETURNING. ?? Or from a select, if the final value is what you mean. What we hide is the way values are made, clearly not the

Re: [GENERAL] DEFERRABLE NOT NULL constraint

2013-02-06 Thread Chris Angelico
On Wed, Feb 6, 2013 at 10:36 PM, Bèrto ëd Sèra berto.d.s...@gmail.com wrote: Hi I still don't see how that's any better than a stored procedure that directly does the INSERT. You can conceal the code every bit as easily. Guys I DO NOT write the customers' security guidelines. I get asked to

Re: [GENERAL] DEFERRABLE NOT NULL constraint

2013-02-05 Thread Chris Angelico
On Tue, Feb 5, 2013 at 11:32 PM, Alban Hertroys haram...@gmail.com wrote: On 5 February 2013 12:41, Andreas Joseph Krogh andr...@officenet.no wrote: There are lots of things you can do, but when it's the ORM which does it you have limited control, and that's the way it should to be (me as

Re: [GENERAL] DEFERRABLE NOT NULL constraint

2013-02-05 Thread Chris Angelico
On Wed, Feb 6, 2013 at 12:20 AM, Bèrto ëd Sèra berto.d.s...@gmail.com wrote: Hi Chris, I don't see any reason to create a record with a NULL and then replace that NULL before committing. Sort out program logic first; then look to the database. I beg to differ here. Say you have a set of

Re: [GENERAL] inet/cidr ipv6 operations

2013-01-29 Thread Chris Angelico
On Tue, Jan 29, 2013 at 9:34 PM, George Shuklin george.shuk...@gmail.com wrote: But IPv6 is differ. Let's assume we wants to get 'next' /64 range. Current range is inet'2a00:ab00:0:1/64'. We want next. Postgres do not allow adding inet + inet, so we need to add natural number. But 'next' /64

Re: [GENERAL] inet/cidr ipv6 operations

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 2:16 AM, Tom Lane t...@sss.pgh.pa.us wrote: Chris Angelico ros...@gmail.com writes: Or alternatively, does PostgreSQL have any integer type larger than 64-bit bigint? I've become accustomed to using bignums in most of my programming; arbitrary-precision integers allow

Re: [GENERAL] noobie question

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 4:45 AM, Steve Clark scl...@netwolves.com wrote: Thanks All, This is for a few very small tables, less 100 records each, that a user can delete and insert records into based on the id which is displayed in a php generated html screen. The tables are rarely updated and

Re: [GENERAL] plpython intermittent ImportErrors

2013-01-15 Thread Chris Angelico
On Tue, Jan 15, 2013 at 4:55 AM, Brian Sutherland br...@vanguardistas.net wrote: I'm guessing that it's some kind of race condition, but I wouldn't know where to start looking. Look for a recursive import (A imports B, B imports A) or multiple threads trying to import simultaneously - Python

Re: [GENERAL] INSERT... WHERE

2013-01-14 Thread Chris Angelico
On Tue, Jan 15, 2013 at 5:26 AM, Robert James srobertja...@gmail.com wrote: On 1/13/13, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 14, 2013 at 3:37 PM, Robert James srobertja...@gmail.com wrote: Thanks. But how do I do that where I have many literals? Something like: INSERT

Re: [GENERAL] Linux Distribution Preferences?

2013-01-13 Thread Chris Angelico
On Mon, Jan 14, 2013 at 11:07 AM, Chris Ernst cer...@zvelo.com wrote: I've seen the opinion of avoid Ubuntu like the plague expressed many times, but it is never followed up with any solid reasoning. Can you (or anyone else) give specific details on exactly why you believe Ubuntu should be

Re: [GENERAL] INSERT... WHERE

2013-01-13 Thread Chris Angelico
On Mon, Jan 14, 2013 at 3:37 PM, Robert James srobertja...@gmail.com wrote: Thanks. But how do I do that where I have many literals? Something like: INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6),(7,8,9) WHERE b IN (SELECT ...) You can use WITH clauses in crazy ways with PostgreSQL. I

Re: [GENERAL] Linux Distribution Preferences?

2013-01-13 Thread Chris Angelico
On Mon, Jan 14, 2013 at 2:46 PM, Scott Marlowe scott.marl...@gmail.com wrote: Most importantly, if you've got LOTS of talent for one distro or another, you're probably best off exploiting it. If 95% of all the developers and ops crew run Ubuntu or Debian, stick to one of them. If they favor

Re: [GENERAL] recasting to timestamp from varchar

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 4:28 AM, Kirk Wythers wythe...@umn.edu wrote: I am trying to re-cast a column as a timestamp ALTER TABLE sixty_min ALTER COLUMN time2 TYPE timestamp; ERROR: column time2 cannot be cast to type timestamp without time zone The column time2 is currently a varchar. I

Re: [GENERAL] Coalesce bug ?

2012-12-21 Thread Chris Angelico
On Sat, Dec 22, 2012 at 2:25 AM, David Johnston pol...@yahoo.com wrote: You have defined the function as IMMUTABLE. The system is allowed to cache the results of a given call (i.e. ps3(2)) and return the value without actually executing the function (never executed). Your second example

Re: [GENERAL] Coalesce bug ?

2012-12-21 Thread Chris Angelico
On Sat, Dec 22, 2012 at 2:40 AM, jg j...@rilk.com wrote: Thank you for the documentation link, but it does not help me. The documentation link states that a function with side effects *must* to be declared VOLATILE (or if you prefer, *not* declared STRICT or IMMUTABLE). Emitting warnings is a

Re: [GENERAL] Coalesce bug ?

2012-12-21 Thread Chris Angelico
On Sat, Dec 22, 2012 at 2:57 AM, jg j...@rilk.com wrote: Hi, Interesting idea. With VOLATILE, the bug disappears. With IMMUTABLE, the EXPLAIN and the execution does not match That is a bug. Even if the behavior has to be different in VOLATILE and IMMUTABLE, the EXPLAIN and the

Re: [GENERAL] Coalesce bug ?

2012-12-21 Thread Chris Angelico
On Sat, Dec 22, 2012 at 3:53 AM, David Johnston pol...@yahoo.com wrote: Chris Angelico wrote, and David dropped the citation (oops!): By the way, why do you declare your functions as STRICT IMMUTABLE and STRICT VOLATILE? Is this a question about the layout of the commands spatially? As I

Re: [GENERAL] Coalesce bug ?

2012-12-21 Thread Chris Angelico
On Sat, Dec 22, 2012 at 9:31 AM, Adrian Klaver adrian.kla...@gmail.com wrote: On 12/21/2012 02:22 PM, Chris Angelico wrote: As I understand it, there are three keywords: VOLATILE, STRICT, and IMMUTABLE. Putting one of those keywords into the declaration flags the function accordingly; if none

Re: [GENERAL] problem with large inserts

2012-12-17 Thread Chris Angelico
On Tue, Dec 18, 2012 at 12:22 AM, Kevin Grittner kgri...@mail.com wrote: Lutz Fischer wrote: I am running postgresql 9.2 on a windows 2008 R2 server with 256 GB and the database is on something like a raid 1+0 (actually a raid1e) consisting of 3x4TB disks (limit of what could easily be fitted

Re: [GENERAL] How to keep the last row of a data set?

2012-12-13 Thread Chris Angelico
On Fri, Dec 14, 2012 at 7:22 AM, John R Pierce pie...@hogranch.com wrote: On 12/13/2012 5:32 AM, seil...@so-net.net.tw wrote: I am trying to implement a mechanism that prohibits the last row of a data set from being deleted. CREATE TABLE t1 (c1 INTEGER,c2 INTEGER, PRIMARY KEY (c1,c2));

Re: [GENERAL] large database

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 7:26 AM, Mihai Popa mi...@lattica.com wrote: Second, where should I deploy it? The cloud or a dedicated box? Forget cloud. For similar money, you can get dedicated hosting with much more reliable performance. We've been looking at places to deploy a new service, and to

Re: [GENERAL] large database

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 9:33 PM, Gavin Flower gavinflo...@archidevsys.co.nz wrote: On Tue, Dec 11, 2012 at 7:26 AM, Mihai Popa mi...@lattica.com wrote: Second, where should I deploy it? The cloud or a dedicated box? Would you say the issue is cloudy? (I'm not being entirely facetious!)

Re: [GENERAL] Problem with aborting entire transactions on error

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 10:36 PM, Zbigniew zbigniew2...@gmail.com wrote: There are always TWO sides (at least two): creators/designers - and the users. Considering how much complexity some kind of modification adds to your - programmer's - code, and how it'll make your life more difficult, at

Re: [GENERAL] Problem with aborting entire transactions on error

2012-12-10 Thread Chris Angelico
On Tue, Dec 11, 2012 at 1:15 AM, David Johnston pol...@yahoo.com wrote: -Original Message- From: Zbigniew [mailto:zbigniew2...@gmail.com] Sent: Monday, December 10, 2012 6:26 AM To: David Johnston Subject: Re: [GENERAL] Problem with aborting entire transactions on error No idea, why

Re: [GENERAL] Problem with aborting entire transactions on error

2012-12-10 Thread Chris Angelico
Caveat: I am not a PostgreSQL hacker, and have not looked into its internals at all, though I've read a number of excellent articles and blog posts on some of its features (TOAST, HOT updates, MVCC, etc). I'm a programmer who has made use of PG from a number of languages, and formed a strong

Re: [GENERAL] libpq - prevent automatic reconnect

2012-12-06 Thread Chris Angelico
On Thu, Dec 6, 2012 at 5:56 AM, Tom Lane t...@sss.pgh.pa.us wrote: I suspect this action isn't dropping the TCP connection. It's only equivalent to a momentary glitch in your network connectivity --- and you'd be very unhappy if that caused TCP connections to go down, because networks have

Re: [GENERAL] how do I grant select to one user for all tables in a DB?

2012-12-04 Thread Chris Angelico
On Wed, Dec 5, 2012 at 2:12 PM, Gauthier, Dave dave.gauth...@intel.com wrote: V9.1.5 on linux User select created (yup, that's right, they want the user name to be select. Guess what ptivs it is to have! Don't kill the messanger :-) ) postgres=# grant select on all tables in schema sde to

Re: [GENERAL] Revoke drop database even for superusers?

2012-12-01 Thread Chris Angelico
On Sun, Dec 2, 2012 at 10:20 AM, Edson Richter edsonrich...@hotmail.com wrote: I've put both files in ~/deny_drop folder, and executed make: # LANG=C make Makefile:13: ../../src/Makefile.global: No such file or directory Makefile:14: /contrib/contrib-global.mk: No such file or directory

Re: [GENERAL] youtube video on pgsql integrity

2012-11-29 Thread Chris Angelico
On Fri, Nov 30, 2012 at 2:00 AM, Ray Stell ste...@vt.edu wrote: On Nov 29, 2012, at 9:27 AM, Kevin Grittner wrote: is everything shown there really the behavior of the MySQL database itself? Good question. I intend to install mysql one day to explore, but just can't find the time. The

Partial authentication (was Re: [GENERAL] sefety of passwords for web-service applications)

2012-11-24 Thread Chris Angelico
On Sat, Nov 24, 2012 at 8:41 PM, Chris Travers chris.trav...@gmail.com wrote: 2) PostgreSQL allows you to move this authentication to a secondary service like Kerberos, LDAP, or anything PAM supported. This means that if you want to you can use a dedicated password store for the passwords

Re: [GENERAL] Maintaining state across function calls

2012-11-20 Thread Chris Angelico
On Tue, Nov 20, 2012 at 12:30 PM, Craig Ringer cr...@2ndquadrant.com wrote: C++ exception handling and the PostgreSQL backend's longjmp() based error handling will interact in exciting and interesting ways. Define interesting? You mean in Wash's sense of Oh God, oh God, we're going to receive

Re: [GENERAL] PG_TERMINATE_BACKEND not working.

2012-11-18 Thread Chris Angelico
On Sun, Nov 18, 2012 at 10:25 PM, Craig Ringer cr...@2ndquadrant.com wrote: On 11/16/2012 02:34 PM, Harry wrote: I am facing problem i.e. connections after execution completed are residing in pg_stat_activity and pg_stat_database. but when i am trying to kill them manually using

Re: [GENERAL] integer instead of 'double precision'?

2012-11-12 Thread Chris Angelico
On Tue, Nov 13, 2012 at 12:16 AM, Willy-Bas Loos willy...@gmail.com wrote: On Fri, Sep 9, 2011 at 5:09 PM, Guillaume Lelarge guilla...@lelarge.info wrote: You divide an integer with an integer, that should give you an integer. Can you tell me the reasoning behind that idea? Is it a rule

Re: PG defaults and performance (was Re: [GENERAL] Unexpectedly high disk space usage RESOLVED (Manual reindex/vacuum))

2012-11-10 Thread Chris Angelico
On Sun, Nov 11, 2012 at 8:05 AM, Jeff Janes jeff.ja...@gmail.com wrote: Totally not. With default settings and default pgbench, the easiest way for host B to beat host A is by lying about the durability of fsync. True. Without the ability to brutally cut the power to a cloud instance or other

PG defaults and performance (was Re: [GENERAL] Unexpectedly high disk space usage RESOLVED (Manual reindex/vacuum))

2012-11-09 Thread Chris Angelico
On Sat, Nov 10, 2012 at 12:26 PM, Steve Crawford scrawf...@pinpointresearch.com wrote: Don't do that. Defaults are good for ensuring that PostgreSQL will start on the widest reasonable variety of systems. They are *terrible* for performance and are certainly wrong for the system you describe.

Re: [GENERAL] alter view foo set () -- fixed in 9.2 stable, but when will it be released?

2012-11-04 Thread Chris Angelico
On Sat, Nov 3, 2012 at 9:15 AM, Joe Van Dyk j...@tanga.com wrote: I'm running into this bug fixed a few days after 9.2.1 was released: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d2292f6405670e1fdac13998f87b4348c71fb9e6 Anyone know when 9.2.2 will go out? Point of random

Re: [GENERAL] alter view foo set () -- fixed in 9.2 stable, but when will it be released?

2012-11-04 Thread Chris Angelico
On Mon, Nov 5, 2012 at 8:48 AM, Ondrej Ivanič ondrej.iva...@gmail.com wrote: On 5 November 2012 08:39, Chris Angelico ros...@gmail.com wrote: Point of random curiosity: The commit mentioned adds the following line: if (rinfo-reloptions strlen(rinfo-reloptions) 0) Is there a reason

Re: [GENERAL] How to find out if the server is postgres slave ??

2012-11-02 Thread Chris Angelico
On Fri, Nov 2, 2012 at 9:06 AM, expertalert expertal...@gmail.com wrote: From command line, is there any way to find out if the server is actually a slave server not master ?? I am writing some script, so for sanity check purpose , i need to know if the server the server i am on , its

Re: [GENERAL] role does not exist

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 12:51 AM, Kevin Burton rkevinbur...@charter.net wrote: If you change the grep to postgres then there are a number of entries (about 17). The output since I don't have a clipboard is too much to try and type in by hand. Try this: ps ax| grep postgresql processes.txt

Re: [GENERAL] role does not exist

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 12:56 AM, Chris Angelico ros...@gmail.com wrote: On Fri, Nov 2, 2012 at 12:51 AM, Kevin Burton rkevinbur...@charter.net wrote: If you change the grep to postgres then there are a number of entries (about 17). The output since I don't have a clipboard is too much to try

Re: [GENERAL] role does not exist

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 1:06 AM, Kevin Burton rkevinbur...@charter.net wrote: If I use vi as my editor how do I copy the text to the clipboard? I would recommend picking an editor that matches the way you post to the list. For example, I use webmail with a GUI web browser, so the editor that I'd

Re: [GENERAL] role does not exist

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 1:18 AM, Kevin Burton rkevinbur...@charter.net wrote: I am not working on the same machine that I read email from. The machine that has the Linux Server on it has no GUI installed. In that case, two options: 1) Copy and paste from your SSH session locally 2) Transfer the

Re: [GENERAL] Unable to do a mailing list proper search

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 1:02 AM, cr...@gtek.biz wrote: On 10/31/2012 12:59 PM, cr...@gtek.biz wrote: list all role privileges Google: site:archives.postgresql.org 'list all role privileges' -- I was kind of hoping The world's most advanced open source database. would offer this

Re: [GENERAL] Where is 'createdb'?

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 2:37 AM, Magnus Hagander mag...@hagander.net wrote: On Thu, Nov 1, 2012 at 4:32 PM, Kevin Burton rkevinbur...@charter.net wrote: The text before this command says, “Once you have Postgres installed, create a schema called book using the following command: $ createdb

Re: [GENERAL] role does not exist

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 8:56 AM, Kevin Burton rkevinbur...@charter.net wrote: That is the problem. There doesn't seem to be any copy on the Linux shell that I am running (I think it is bash). My crystal ball tells me that you're SSHing to your remote server, running SSH in some kind of local

Re: [GENERAL] role does not exist

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 10:35 AM, Adrian Klaver adrian.kla...@gmail.com wrote: On 11/01/2012 03:03 PM, Chris Angelico wrote: My crystal ball tells me that you're SSHing to your remote server, running SSH in some kind of local terminal. It's the local terminal that will offer copy/paste

Re: [GENERAL] pgsql server reset the connection immediately after connected

2012-11-01 Thread Chris Angelico
in the log file. Is there a long delay between connecting and executing a query? It may be that something disconnected you during that time. Or could the server have been restarted? Can you make a simple Python script that always fails in this way? Chris Angelico -- Sent via pgsql-general

Re: [GENERAL] pgsql server reset the connection immediately after connected

2012-11-01 Thread Chris Angelico
On Fri, Nov 2, 2012 at 2:43 PM, Dongkuo Ma luc@gmail.com wrote: I connect to database and then fork a new process! Now it's ok. Thanks. Ah, yes, that would be a dangerous thing to do :) ChrisA -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] How to print application_name in log_line_prefix (using %a)?

2012-10-29 Thread Chris Angelico
On Mon, Oct 29, 2012 at 5:22 PM, Tianyin Xu t...@cs.ucsd.edu wrote: Thanks a lot, Chris! Yes, the manual said that It is typically set by an application upon connection to the server. exactly your approach. But the examples you gave me is to print the application_name in the query results,

Re: [GENERAL] How to print application_name in log_line_prefix (using %a)?

2012-10-29 Thread Chris Angelico
On Mon, Oct 29, 2012 at 5:44 PM, Tianyin Xu t...@cs.ucsd.edu wrote: Got it! Thanks, Chris! I still wonder why application_name appears in the configuration file if it cannot take effort :-P Not sure what you mean by that, but my postgresql.conf doesn't have anything about application_name.

Re: [GENERAL] How to print application_name in log_line_prefix (using %a)?

2012-10-29 Thread Chris Angelico
On Tue, Oct 30, 2012 at 12:53 AM, Adrian Klaver adrian.kla...@gmail.com wrote: On 10/29/2012 04:00 AM, Chris Angelico wrote: Not sure what you mean by that, but my postgresql.conf doesn't have anything about application_name. But if it did, it would be a default that an application can

Re: [GENERAL] Plug-pull testing worked, diskchecker.pl failed

2012-10-27 Thread Chris Angelico
On Sat, Oct 27, 2012 at 4:26 PM, Greg Smith g...@2ndquadrant.com wrote: In general, through, diskchecker.pl is the more sensitive test. If it fails, storage is unreliable for PostgreSQL, period. It's good that you've followed up by confirming the real database corruption implied by that is

Re: [GENERAL] Plug-pull testing worked, diskchecker.pl failed

2012-10-24 Thread Chris Angelico
On Tue, Oct 23, 2012 at 9:51 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Mon, Oct 22, 2012 at 7:17 AM, Chris Angelico ros...@gmail.com wrote: After reading the comments last week about SSDs, I did some testing of the ones we have at work - each of my test-boxes (three with SSDs, one

Re: [GENERAL] Need sql to pull data from terribly architected table

2012-10-24 Thread Chris Angelico
On Thu, Oct 25, 2012 at 2:42 AM, Steve Litt sl...@troubleshooters.com wrote: Also, with the organization they're using, one can make new columns on the fly. ... Anyway, the keypuncher is punching data, comes across a brand new type of data (let's say artist), so for this row the keypuncher

[GENERAL] Plug-pull testing worked, diskchecker.pl failed

2012-10-22 Thread Chris Angelico
After reading the comments last week about SSDs, I did some testing of the ones we have at work - each of my test-boxes (three with SSDs, one with HDD) subjected to multiple stand-alone plug-pull tests, using pgbench to provide load. So far, there've been no instances of PostgreSQL data

Re: [GENERAL] Postgres Login Users Details

2012-10-22 Thread Chris Angelico
On Mon, Oct 22, 2012 at 7:47 PM, Vishalakshi Navaneethakrishnan nvishalak...@sirahu.com wrote: Hi all, I need to know who are all access database from different remote host. Example : User1@host1 logged / access db dbuser@dbname in Dbserver How can i get this information? As suggested,

Re: [GENERAL] Plug-pull testing worked, diskchecker.pl failed

2012-10-22 Thread Chris Angelico
On Tue, Oct 23, 2012 at 6:26 AM, Jeff Janes jeff.ja...@gmail.com wrote: What did you do to look for corruption? That PosgreSQL succeeds at going through crash-recovery and then starting up is not a good indicator that there is no corruption. I fired up Postgres and looked at the logs for any

Re: [GENERAL] obtain the difference between successive rows

2012-10-20 Thread Chris Angelico
On Sun, Oct 21, 2012 at 2:30 AM, Berend Tober bto...@broadstripe.net wrote: What about if there is more than one column you want the difference for (... coincidentally I am writing a article on this topic right now! ...), say a table which is used to record a metered quantity at not-quite

Re: [GENERAL] obtain the difference between successive rows

2012-10-20 Thread Chris Angelico
On Sun, Oct 21, 2012 at 3:29 AM, Raymond O'Donnell r...@iol.ie wrote: On 20/10/2012 17:23, Tom Lane wrote: Having said that, they are pretty expensive. I tend to agree that doing the processing on the application side might be faster --- but only if you've got a place to put such code there.

Re: [GENERAL] 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

2012-10-18 Thread Chris Angelico
On Thu, Oct 18, 2012 at 3:08 PM, Craig Ringer ring...@ringerc.id.au wrote: BTW, the issue with the underlying question is that their name column is unique. They expected to get a serialization failure on duplicate insert into name, not a unique constraint violation. The question wasn't why

Re: [GENERAL] 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

2012-10-18 Thread Chris Angelico
On Thu, Oct 18, 2012 at 11:26 PM, Kevin Grittner kgri...@mail.com wrote: updating a last_used number in a table and using the result (if it is *is* critical that there are no gaps in the numbers). Correct me if I'm wrong, but wouldn't: update some_table set last_used=last_used+1 returning

Re: [GENERAL] 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

2012-10-18 Thread Chris Angelico
On Fri, Oct 19, 2012 at 1:22 AM, Kevin Grittner kgri...@mail.com wrote: Now, if no records are inserted or deleted by another connection, how many rows will be deleted by this statement?: delete from rc where id = (select min(id) from rc); It's a trick question; the answer depends on a race

Re: [GENERAL] PostgreSQL training recommendations?

2012-10-17 Thread Chris Angelico
On Thu, Oct 18, 2012 at 12:56 AM, Vincent Veyron vv.li...@wanadoo.fr wrote: I am surprised none of the fine contributors to this thread mentionned an activity they practice extensively, which is reading this list's content every day. Best training material ever in my opinion. A pay-for

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread Chris Angelico
On Thu, Oct 18, 2012 at 2:32 AM, John Beynon j...@kyan.com wrote: I just managed to solve the problem infact. The trailing 'e' character on the name was different for one row. All my tools, (pgadmin and the source data in openoffice) showed the same 'e' character but psql showed it as

Re: [GENERAL] Improve MMO Game Performance

2012-10-17 Thread Chris Angelico
On Mon, Oct 15, 2012 at 7:16 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: - Set fsync=off and hope you don't crash. Ouch. I might consider that for a bulk import operation or something, but not for live usage. There's plenty else can be done without risking data corruption. ChrisA -- Sent

Re: [GENERAL] database corruption questions

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 1:13 PM, Craig Ringer ring...@ringerc.id.au wrote: * Never, ever, ever use cheap SSDs. Use good quality hard drives or (after proper testing) high end SSDs. Read the SSD reviews periodically posted on this mailing list if considering using SSDs. Make sure the SSD has a

Re: [GENERAL] Trajectory of a [Pg] DBA

2012-10-05 Thread Chris Angelico
On Fri, Oct 5, 2012 at 6:44 AM, Thalis Kalfigkopoulos tkalf...@gmail.com wrote: Is it an easier and more common entry point to be a part-time DBA e.g. perform DBA duties as part of being a U**X sysadmin? Is it more common to start as a developer and change focus to DBA? In particular how

Re: [GENERAL] Thousands of schemas and ANALYZE goes out of memory

2012-10-02 Thread Chris Angelico
On Wed, Oct 3, 2012 at 10:09 AM, Jeff Janes jeff.ja...@gmail.com wrote: On Tue, Oct 2, 2012 at 10:38 AM, Hugo Nabble hugo.t...@gmail.com wrote: That might be the problem. I think with 32 bits, you only 2GB of address space available to any given process, and you just allowed shared_buffers to

Re: [GENERAL] Question about permissions on database.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 6:47 AM, Ryan Kelly rpkell...@gmail.com wrote: On Sat, Sep 22, 2012 at 11:35:00PM +0300, Condor wrote: Hello, I wanna ask: is there a short way to giver permission to one user to select/insert (all privileges) on whole database ? Im create a user and try to give him

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-20 Thread Chris Angelico
On Wed, Sep 19, 2012 at 11:15 PM, David Johnston pol...@yahoo.com wrote: I could maybe see something like the following having some value: SELECT inverse FROM data WHERE x0 AND inverse .5 MACRO inverse (1/x) WITH macros AS (SELECT *,1/x AS inverse FROM data) SELECT inverse FROM macros

Re: [GENERAL] Using psql -f to load a UTF8 file

2012-09-20 Thread Chris Angelico
On Fri, Sep 21, 2012 at 11:21 AM, Craig Ringer ring...@ringerc.id.au wrote: I strongly disagree. The BOM provides a useful and standard way to differentiate UTF-8 encoded text files from the random pile of encodings that any given file could be. The only reliable way to ascertain the encoding

Re: [GENERAL] Using psql -f to load a UTF8 file

2012-09-20 Thread Chris Angelico
On Fri, Sep 21, 2012 at 2:39 PM, John R Pierce pie...@hogranch.com wrote: On 09/20/12 10:27 AM, Alan Millington wrote: I am using Notepad, which inserts the byte order mark. Following the links a bit further, I gather that the version of Notepad that I am using may not identify a UTF8 file

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-18 Thread Chris Angelico
On Tue, Sep 18, 2012 at 4:44 PM, Craig Ringer ring...@ringerc.id.au wrote: On 09/18/2012 07:32 AM, Tom Lane wrote: It's easier to understand why this is if you realize that SQL has a very clear model of a pipeline of query execution. I just wish they hadn't written it backwards! It'd be

Re: [GENERAL] Double types

2012-09-18 Thread Chris Angelico
On Wed, Sep 19, 2012 at 7:25 AM, Hall, Samuel L (Sam) sam.h...@alcatel-lucent.com wrote: I have an application that writes an Excel Spreadsheet to postgres. For the values that go in number fields, I check the Excel values for dbnull and set the parameters to 0, like this:

Re: [GENERAL] Can a view use a schema search_path?

2012-09-17 Thread Chris Angelico
On Mon, Sep 17, 2012 at 7:06 PM, Adam Mackler adammack...@gmail.com wrote: Am I correct in concluding that there's no way to have a single view in the public schema that selects data from tables in different other schemas depending on my search_path at the time I execute a query involving that

Re: [GENERAL] Official C++ API for postgresql?

2012-09-17 Thread Chris Angelico
On Tue, Sep 18, 2012 at 5:56 AM, Adrian Klaver adrian.kla...@gmail.com wrote: I think the confusing part is: This library works on top of the C-level API library, libpq. It comes with postgres The it refers to libpq not libpqxx. Sounds to me like a wording change might be in order -

Re: [GENERAL] Too far out of the mainstream

2012-09-05 Thread Chris Angelico
On Wed, Sep 5, 2012 at 7:40 PM, Achilleas Mantzios ach...@smadev.internal.net wrote: (single master, 80+ slaves in 80+ vessels in the 7 seas (80+ = 80 and growning)) Cool!! How do your nodes communicate with each other? Is it an off-line resynchronization, or do you maintain long-range

  1   2   3   >