Re: [GENERAL] Conversion of columns during CSV Import

2012-06-29 Thread Alban Hertroys
) as a table inside the database. Once you have that, it should be fairly easy to craft an INSERT ... SELECT that converts the data on the fly. Or use an ETL tool - Pentaho is popular. Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Alban Hertroys
Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest. -- 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] create database from template requires the source database to be unused

2012-06-28 Thread Alban Hertroys
I've read that postgres uses MVCC for transactions, and that it creates snapshots of the database for each transaction.  Couldn't the create database command just use that snapshot? Database creation cannot be done inside a transaction (one of the few DDL statements that can't), so no. -- If

Re: [GENERAL] dblink causing import errors

2012-06-26 Thread Alban Hertroys
On 26 June 2012 10:59, Christoph Zwerschke c...@online.de wrote: Our developers like the dblink modules, so I have installed it into the template1 database. They also like to import old database dumps after creating new databases with dbcreate. But then they get irritated by the error messages

Re: [GENERAL] Help, server doesn't start

2012-06-25 Thread Alban Hertroys
Yes, pg_dump output from 8.3 should restore fine to 9.1. Pardon my ignorance if this changed in recent versions, but shouldn't that read: Yes, pg_dump 9.1 output from 8.3 should restore fine to 9.1? -- If you can't see the forest for the trees, Cut the trees and you'll see there is no forest.

Re: [GENERAL] pg_dump not dumping all tables

2012-06-22 Thread Alban Hertroys
On 22 June 2012 10:45, Stefan Schwarzer stefan.schwar...@unep.org wrote: Hi there, I am pg_dump-ing all tables from schema public on the server       /usr/local/pgsql/bin/pg_dump -U user my_database --schema=public --encoding=UTF-8 dump.sql and re-loading it via psql on my local machine.

Re: [GENERAL] pgstat wait timeout : permission denied

2012-06-19 Thread Alban Hertroys
2012-06-19 09:33:38 CESTWARNING:  01000: pgstat wait timeout 2012-06-19 09:33:38 CESTLOCATION:  backend_read_statsfile, .\src\backend\postmaster\pgstat.c:3807 2012-06-19 09:33:41 CESTLOG:  42501: could not rename temporary statistics file pg_stat_tmp/pgstat.tmp to pg_stat_tmp/pgstat.stat:

Re: [GENERAL] Submit query using dblink that hung the host

2012-06-15 Thread Alban Hertroys
the local database in that query at all. Perhaps you could query the database on port 4001 instead? That would seem to make more sense for this particular query. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] Problem installing extensions on Lion

2012-06-14 Thread Alban Hertroys
On 12 June 2012 14:21, Stefan Schwarzer stefan.schwar...@unep.org wrote: But the make process gives me this: cd contrib/tablefunc tablefunc $ make gcc -Os -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk I think that's where it looks for the standard C headers? In that case that's what

Re: [GENERAL] Create view is not accepting the parameter in postgres functions

2012-06-13 Thread Alban Hertroys
-^^ You can't mix those. I don't think SQL functions support named parameters, so using positional parameters throughout would be the solution. Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest. -- Sent

Re: [GENERAL] Trying to execute several queries involving temp tables in a PHP script

2012-06-13 Thread Alban Hertroys
On 13 June 2012 15:12, Alexander Farber alexander.far...@gmail.com wrote: And when I split my statements into multiple prepare()/execute() or query() calls, then the temp. tables aren't found anymore. Did you remember to wrap them in a transaction like you did in your prepared statement? --

Re: [GENERAL] import *.backup-file (PostGIS - not mine)

2012-06-11 Thread Alban Hertroys
On 11 June 2012 10:42, gipsy-king1 stue...@gis-consult.de wrote: I have to import and watch/edit data stored in an .backup-file. This is a backup-file, stored by an other firm. Can you tell me what I have to do? Is that a Postgres dump? If so, is it a plain text dump, a compressed dump or a

Re: [GENERAL] problem after upgrade db missing

2012-06-06 Thread Alban Hertroys
On 5 June 2012 23:51, Aleksander Rozman andy.roz...@gmail.com wrote: Like I said before all databases were missing... One of thoose database was very important, but since I didn't have time I didn't pursue it further. If it was very important, that means that you have backups, right? From the

Re: [GENERAL] pg_database_size differs from df -s

2012-06-06 Thread Alban Hertroys
On 6 Jun 2012, at 16:33, Frank Lanitz wrote: the result is much bigger than running a df -s over the postgres folder - Its about factor 5 to 10 depending on database. Is your du reporting sizes in Bytes or blocks or ...? Alban Hertroys -- The scale of a problem often equals the size

Re: [GENERAL] Updateable Views or Synonyms.

2012-05-30 Thread Alban Hertroys
reason or another. You can create updateable views by adding INSERT, UPDATE and DELETE rules to them. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Export and import from one postgres server to another

2012-05-29 Thread Alban Hertroys
On 29 May 2012 14:58, Adrian Klaver adrian.kla...@gmail.com wrote: Q: Why can't I reload the SQL script I dumped in the SQL window? A: The following limitations currently exist in SQL script execution:        * 'psql' commands such as '\connect' will not work at all. Wait a minute! They use

Re: [GENERAL] enhanced linestyles for psql

2012-05-24 Thread Alban Hertroys
On 24 May 2012 15:33, Pavel Stehule pavel.steh...@gmail.com wrote: hello I wrote patch for PostgreSQL 9.1 and 9.2 that adds more linestyles and border styles to console Nice job! I'm not entirely enthusiastic about the option names though. Would it help to split the setting into several? For

Re: [GENERAL] UDF in C slow

2012-05-11 Thread Alban Hertroys
On 11 May 2012 15:57, Inanc Seylan inanc.sey...@gmail.com wrote: Hi all, I have implemented a user-defined function in C that returns a boolean value after some computation. Now I have a query Q such that when I specify the function in the WHERE clause of Q, Q runs in 40 secs and if I don't

Re: [GENERAL] Prepared statements performance

2012-05-10 Thread Alban Hertroys
On 10 May 2012 11:30, Daniel McGreal daniel.mcgr...@redbite.com wrote: I put the multi-value inserts in as I was curious as to why prepared statements would be slower given they only plan the query once (as also does the multi-value insert, I assume). That's a common misconception. The reason

Re: [GENERAL] Prepared statements performance

2012-05-10 Thread Alban Hertroys
On 10 May 2012 15:05, Radosław Smogura rsmog...@softperience.eu wrote: May I ask what kind of planning may occur during insert? Well, for example, if there's a unique constraint on the table then the database will have to check that the newly inserted values don't conflict with values that are

Re: [GENERAL] FATAL: lock file postmaster.pid already exists

2012-05-08 Thread Alban Hertroys
script removal of the pid file if its creation date is before the time the system started booting up. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] new rows based on existing rows

2012-05-03 Thread Alban Hertroys
. I was wondering, would an updatable view with a pseudo-column for the old_id do it? Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Memory Management in pqlib, Garbage Collection support

2012-05-03 Thread Alban Hertroys
On 3 May 2012 09:39, Alexander Reichstadt l...@mac.com wrote: Thanks, that's answering my question. In Objective-C as well as many other I notice that you're talking about pqlib instead of libpq. Perhaps pqlib is an Obj-C wrapper around libpq that most of us just don't know about? Obj-C is not a

Re: [GENERAL] Re: how to set up automatically startup database when the server boot or reboot.

2012-04-27 Thread Alban Hertroys
On 27 April 2012 16:47, leaf_yxj leaf_...@163.com wrote: David, Thanks for your reminder. My database version is 8.2.15. And My os platform is Linux 5.5.  Thanks I really appreciate it. Grace There is no such thing as Linux 5.5. But since you're on _a_ Linux distribution (there are many),

Re: [GENERAL] Simple way to get missing number

2012-04-24 Thread Alban Hertroys
On 24 April 2012 16:15, Emi Lu em...@encs.concordia.ca wrote: Good morning, May I know is there a simple sql command which could return missing numbers please? For example, t1(id integer) values= 1, 2, 3 500 select miss_num(id) from   t1 ; Will return: ===

Re: [GENERAL] remove some rows from resultset

2012-04-19 Thread Alban Hertroys
.contract_name order by b1.org_id, b1.contract_name; Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- 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] problem with serial

2012-04-19 Thread Alban Hertroys
On 19 April 2012 16:19, Yvon Thoraval yvon.thora...@gmail.com wrote: why ? Because you're doing it wrong, apparently. However, since you left out all the relevant information that could have helped determining what you're doing and what errors you got, we can't help you. Please provide the

Re: [GENERAL] Performance degrades until dump/restore

2012-04-19 Thread Alban Hertroys
On 19 April 2012 16:09, Chris bajasa...@gmail.com wrote: Hi Chris, It is postgres 9.1, with default settings.  The autovacuum settings are all commented out, I have not change dthem. My understanding is that analyze is also run automatically by default. So, I believe the answer to both

Re: [GENERAL] Result sets from functions

2012-04-16 Thread Alban Hertroys
On 16 April 2012 09:24, Liam Caffrey liam.caff...@gmail.com wrote: Hi, There is a feature that I have used in SQL Server which I find really useful for debugging (without using a debugger!!). It is this I can write multiple select * from some_table statements throughout my stored

Re: [GENERAL] Updating pg_attribute to change field's data type from integer to bigint on very large table

2012-04-14 Thread Alban Hertroys
test data first. There's definitely a risk of losing everything in the database. It's probably a _really_ bad idea :P Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Searchable chess positions in a Postgress DB

2012-04-11 Thread Alban Hertroys
On 11 April 2012 09:15, Sidney Cadot sid...@jigsaw.nl wrote: Dear all, As a hobby project, I am toying around with a database containing about 5 million chess games. On average, these games have about 80 positions (~ 40 moves by both black and white), which means there are about 400 million

Re: [GENERAL] Please help me to take a look of the erros in my functions. Thanks.

2012-04-03 Thread Alban Hertroys
. Of course, that may not be applicable to the her situation. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [GENERAL] Please help me to take a look of the erros in my functions. Thanks.

2012-04-03 Thread Alban Hertroys
The tablename doesn't exist.doesn END IF ; END; $$ LANGUAGE 'plpgsql' security definer; Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] default value returned from sql stmt

2012-03-30 Thread Alban Hertroys
behave as Pavel describes. Until you add an ORDER BY to your query. A more robust implementation would be: select anum, 0 from t1 where anum = 4 union all select 100, 1 limit 1 order by 2; If you don't want the extra column in your query results, you can wrap the query in another select. Alban

Re: [GENERAL] user get notification when postgresql database updated

2012-03-30 Thread Alban Hertroys
can't notify your browser-based application from your server. You will have to poll. Googling for ajax push turned up this explanation: http://www.subbu.org/blog/2006/04/dissecting-ajax-server-push Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql

Re: [GENERAL] why is pg_dump so much smaller than my database?

2012-03-29 Thread Alban Hertroys
On 29 March 2012 09:11, John R Pierce pie...@hogranch.com wrote: On 03/28/12 10:32 PM, Carson Gross wrote: I've got a pretty big database (~30 gigs) and when I do a pg_dump, it ends up only being 2 gigs. I suppose you're talking about a plain text dump here? A compressed dump would likely[*]

Re: [GENERAL] Facing error while restoring the database

2012-03-27 Thread Alban Hertroys
On 27 March 2012 11:33, Akshay Joshi akshay.jo...@enterprisedb.com wrote: Hi I am facing issue while restoring the database. I have taken the backup of my database using pg_dump and then create new database and try to restore it using pg_restore. I am using PostgreSQL 9.0. What is the error?

Re: [GENERAL] Facing error while restoring the database

2012-03-27 Thread Alban Hertroys
On 27 March 2012 15:12, Akshay Joshi akshay.jo...@enterprisedb.com wrote: On Tue, Mar 27, 2012 at 6:15 PM, Alban Hertroys haram...@gmail.com wrote: On 27 March 2012 11:33, Akshay Joshi akshay.jo...@enterprisedb.com wrote:    pg_restore: restoring data for table sample    pg_restore

Re: [GENERAL] loading a function from a file

2012-03-26 Thread Alban Hertroys
On 26 March 2012 11:32, and andreaesposit...@gmail.com wrote: I have read it on logging psql -h host database  create_some_func.sql but then i am forced to redo the login.Is there another way to do it? If you're working on the database server, then you can skip the -h host bit and use a

Re: [GENERAL] plpgsql function to insert or update problem

2012-03-24 Thread Alban Hertroys
in your PK ;) Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest. -- 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] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-17 Thread Alban Hertroys
on the slave.) I recall someone in here had a similar problem where the table's FILLFACTOR on the slave was different from the one on the master. Perhaps that would explain the gaps you're seeing? Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via

Re: [GENERAL] Problem for restoure data base Postgre

2012-03-16 Thread Alban Hertroys
the restore. CREATE EXTENSION is new to Postgres 9.x, so your pg_restore is probably from a Postgres 8.x installation. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Alban Hertroys
of tablespaces, but it's possible that moving it would trigger a rewrite of the contents such that the effect would be similar to what CLUSTER would do for you - it probably just moves the files though, in which case you'd perform the CLUSTER on the new TABLESPACE and then move it back. Alban

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-12 Thread Alban Hertroys
On 12 March 2012 09:20, Nur Hidayat hidayat...@gmail.com wrote: FYI, after I changed text field into character varying, I vaccuum the whole database, resulting in much smaller database size What I think that happened in your case is that because of the data-type change every row in the table

Re: [GENERAL] Re: One transaction by connection - commit subdetails without release master transaction?

2012-02-29 Thread Alban Hertroys
serialise transactions on one connection just fine. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- 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] A better COPY?

2012-02-26 Thread Alban Hertroys
COPY from STDIN and supply the contents of the file after that. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [GENERAL] Optimise PostgreSQL for fast testing

2012-02-24 Thread Alban Hertroys
). And look into parallelising that workload. PG was designed for parallel workloads. Using a single process you're still paying for that and not benefitting. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Alban Hertroys
On 17 February 2012 17:19, Scott Marlowe Have you tried casting to varchar(1000) or something like that? Don't MySQL's varchars only go to 255? That's why every MySQL database uses blobs for text data, isn't it? -- If you can't see the forest for the trees, Cut the trees and you'll see there

Re: [GENERAL] Error while importing CSV file

2012-02-07 Thread Alban Hertroys
On 7 February 2012 06:43, Lockas w_war...@hotmail.com wrote: OK .. my offending line number is 4533 How can i remove it while copying ? You can remove it before copying or after, but not while. -- If you can't see the forest for the trees, Cut the trees and you'll see there is no forest. --

Re: [GENERAL] How to write in Postgres

2012-02-07 Thread Alban Hertroys
On 7 February 2012 15:03, mgo...@isstrucksoftware.net wrote: How do I convert this to PostGres. I'm getting a error ERROR: syntax error at or near ( LINE 23: set chr = substr(lfeid,idx,1); Assuming you are writing this as pl/pgsql code, the way you do your variable assignments is wrong on

Re: [GENERAL] Error while importing CSV file

2012-02-06 Thread Alban Hertroys
On 6 February 2012 07:37, Lockas w_war...@hotmail.com wrote: I've tried a lot of sizes but I still have messages in my log saying: *  ---  ERROR:  value too long for type character varying(200)  --- * Why is this? There are no other varchar(200) columns in my DB at all, no other table.

Re: [GENERAL] Error while importing CSV file

2012-02-06 Thread Alban Hertroys
On 6 February 2012 13:26, Lockas w_war...@hotmail.com wrote: * ok then if I want to except that row from copying. how i can write it ?* You can either remove the offending line(s) from the csv file or copy to a staging table that doesn't have those limitations on field lengths first. -- If

Re: [GENERAL] Why this regexp matches?!

2012-02-04 Thread Alban Hertroys
this is related. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- 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] Help speeding up a left join aggregate

2012-01-31 Thread Alban Hertroys
a LEFT JOIN (SELECT advertisement_id, AVG(price) AS price, SUM(price) AS download_revenue, COUNT(1) AS downloads FROM songs_downloaded GROUP BY advertisement_id) AS sd ON a.id = sd.advertisement_id AND a.advertiser_id = sd.advertiser_id WHERE advertiser_id = 6553406 Alban Hertroys -- Screwing up

Re: [GENERAL] [RFE] auto ORDER BY for SELECT

2012-01-24 Thread Alban Hertroys
On 24 January 2012 09:29, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 23, 2012 at 11:17 PM, Douglas Eric sekk...@hotmail.com wrote: I suggest to change this behavior. If one makes a SELECT statement without any ORDER BY, it would be clever to automatically sort by the first primary key

Re: [GENERAL] update with from

2012-01-23 Thread Alban Hertroys
On 23 January 2012 14:48, Sim Zacks s...@compulab.co.il wrote: In my tests, if the joined rows are sorted it always updates with the first row. Does anyone have any other experiences, or should I be concerned that at some point it will behave differently? I checked my tests again. It always

Re: [GENERAL] Update takes longer than expected

2012-01-10 Thread Alban Hertroys
On 10 January 2012 15:46, Jerry Sievers gsiever...@comcast.net wrote: We're trying to migrate the app from mysql to pg and this is one of the performance bottle-necks.  Unfortunately it slows down every request by about 5 seconds. That's a delay that could be due to DNS problems or other

Re: [GENERAL] Supporting SQL/MED DATALINK

2012-01-09 Thread Alban Hertroys
On 9 January 2012 09:56, Damiano ALBANI I believe DB2 is pretty much it in this area. For the record, it looks like MS SQL Server has some equivalent feature : FILESTREAM. And Oracle has BFILE. I've actually been thinking about how to implement something like this for Postgres, but the

Re: [GENERAL] Supporting SQL/MED DATALINK

2012-01-09 Thread Alban Hertroys
On 9 January 2012 12:36, John R Pierce pie...@hogranch.com wrote: On 01/09/12 3:07 AM, Alban Hertroys wrote: For the record, it looks like MS SQL Server has some equivalent feature :  FILESTREAM. And Oracle has BFILE. aren't these things functionally similar to PG's LO (large object

Re: [GENERAL] Binary Large Objects (LOB/BLOB) in Hibernate and JDBC: Unresolved issues

2012-01-09 Thread Alban Hertroys
On 9 January 2012 14:55, Radosław Smogura rsmog...@softperience.eu wrote: So responsible for this is database, but database doesn't have real BLOBs, this what is made in PG JDBC driver is just not perfect way to add this functionality to PostgreSQL. I think you should elaborate on what you

Re: [GENERAL] Binary Large Objects (LOB/BLOB) in Hibernate and JDBC: Unresolved issues

2012-01-09 Thread Alban Hertroys
that it was in the SQL query string. This is probably documented, but I don't have time to dig into the manuals right now. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] JOIN column maximum

2012-01-08 Thread Alban Hertroys
much do female Asians make compared to their mobility. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- 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] Duplicated entries are not ignored even if a do instead nothing rule is added.

2012-01-04 Thread Alban Hertroys
You accidentally clicked Reply instead of Reply-all ;) On 4 Jan 2012, at 3:03, 邓尧 wrote: On Tue, Jan 3, 2012 at 3:42 PM, Alban Hertroys haram...@gmail.com wrote: On 3 Jan 2012, at 5:20, 邓尧 wrote: Hi, I'm new to pgsql, I need the do something like the INSERT IGNORE in mysql. After

Re: [GENERAL] Large Objects and and Vacuum

2012-01-02 Thread Alban Hertroys
On 31 December 2011 00:54, Simon Windsor simon.wind...@cornfield.me.uk wrote: I am struggling with the volume and number of XML files a new application is storing. The table pg_largeobjects is growing fast, and despite the efforts of vacuumlo, vacuum and auto-vacuum it keeps on growing in size

Re: [GENERAL] Duplicated entries are not ignored even if a do instead nothing rule is added.

2012-01-02 Thread Alban Hertroys
amounts of data. I seem to recall pgfouine is such an application, but I've never used it. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Verifying a timestamp is null or in the past

2011-12-30 Thread Alban Hertroys
to the query anyway, that's up to personal preference: select 1 from pref_users where id=_from and (vip is not null or vip current_timestamp + interval '1 week'); Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest. -- Sent via pgsql-general

Re: [GENERAL] Error while loading sql file

2011-12-26 Thread Alban Hertroys
that if recode runs into problems recoding a string to UTF-8 it will leave it untouched, but that will NOT happen in all cases. Sometimes it will succeed, even though the result has no meaning to a human. That's a nasty problem you ran into, I hope the archives provide the wisdom you need. Alban

Re: [GENERAL] postgresql triggers - defining a global resource (java)

2011-12-24 Thread Alban Hertroys
to kernel-level). If your PG is pre-9, then you'll want some mechanism that keeps a pool of pending data for RPC. In 9.0 and up you can send record information along with NOTIFY. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing

Re: [GENERAL] PostgreSQL DBA in SPAAAAAAAACE

2011-12-24 Thread Alban Hertroys
won too. I consider it a compliment :) Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll see there is no forest. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [GENERAL] pg_restore should restore the schema comments and the database properties

2011-12-20 Thread Alban Hertroys
On 20 December 2011 15:35, Adrian Klaver adrian.kla...@gmail.com wrote: To elaborate on my previous answer, search_path is in postgresql.conf because it is tied to the database cluster not a particular database. Not necessarily, it can also be tied to a schema or a role or (I assume) a

Re: [GENERAL] PostgreSQL DBA in SPAAAAAAAACE

2011-12-20 Thread Alban Hertroys
On 20 December 2011 16:01, Merlin Moncure mmonc...@gmail.com wrote: On Tue, Dec 6, 2011 at 10:56 AM, Joe Miller joe.d.mil...@gmail.com wrote: guess who won! :-D Ah cool. I'll wave when I get outside :) -- If you can't see the forest for the trees, Cut the trees and you'll see there is no

Re: [GENERAL] design help for performance

2011-12-20 Thread Alban Hertroys
NOT NULL DEFAULT 0 ); Yes, those cascades are on purpose - the data in C is useless without the accompanying record in A. Also, the PK makes sure it stays a 1:1 relationship. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Alban Hertroys
On 19 December 2011 16:26, MURAT KOÇ m.ko...@gmail.com wrote: Hi Adrian, I wrote a desktop application on Windows by using Npgsql.dll. So, I send SQL statement to database from this application code. I can't use psql command line (I know \password command changes password encrypted text).

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Alban Hertroys
Of course, we could create login credentials, login configuration options for every DBA colleagues. But, as I said previous that big problem is PostgreSQL logs include changing passwords on clear-text not encrypted No, the big problem is that you don't consider your fellow DBA's reliable.

Re: [GENERAL] Controlling complexity in queries

2011-12-14 Thread Alban Hertroys
is sufficient - no need to check whether there are other matches after the first one. That said, wouldn't a foreign key constraint help you even better? If questions.user_id is required to refer to an existing users.id (by an FK constraint), than the check in the query becomes moot. Alban

Re: [GENERAL] Correct syntax to create partial index on a boolean column

2011-12-14 Thread Alban Hertroys
that are not gluten-free of course. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- 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] [pgadmin-support] Help for Migration

2011-12-07 Thread Alban Hertroys
On 7 December 2011 10:08, mamatha_kagathi_c...@dell.com wrote: The procedure definition is CREATE OR REPLACE PROCEDURE -- So I am not calling a function but a procedure. I don't think CREATE PROCEDURE is actually a valid command in Postgres. The 9.0 documentation seems to confirm that

Re: [GENERAL] How to retrieve rows with empty value in numeric(12,8) columns

2011-12-06 Thread Alban Hertroys
On 6 December 2011 12:00, Adarsh Sharma adarsh.sha...@orkash.com wrote: select * from table where lat IS NULL; can you explain how it works or any link that explain the difference between 2 queries. That's because of the 3-valued logic of SQL. x=NULL always evaluates to NULL, because it is

Re: [GENERAL] Foreign keys question (performance)

2011-12-04 Thread Alban Hertroys
constraint violation. If you do, then it needs to modify the relevant rows in the child table. Likewise, INSERTs and UPDATEs in the child table need to verify that - if their reference key changed - they're still referencing a valid row. Alban Hertroys -- Screwing up is an excellent way

Re: [GENERAL] Weird behavior: deleted row still in index?

2011-12-04 Thread Alban Hertroys
a DELETE trigger or rule on this table that does something unexpected? It is indeed a possibility that this is a corrupted index, but that is not something that happens unless more serious matters have been (or are) at hand, like hardware failures. Alban Hertroys -- The scale of a problem often

Re: [GENERAL] Conditional left join

2011-12-01 Thread Alban Hertroys
On 1 December 2011 13:16, Amitabh Kant amitabhk...@gmail.com wrote: I am trying (through conditional left join?) to fetch all records of tbldata and the operator name from tbloperators who was operating the unit at event time. If no operator was present, it should return null. I think you want

Re: [GENERAL] Stored function debugging help

2011-11-28 Thread Alban Hertroys
On 28 November 2011 13:36, JavaNoobie vivek...@enzentech.com wrote: Well I'm not fond of using a temporary table either. But how would I be able to iterate over a set of consumers while using a join ? From my (limited) , using only a join I would only be able to generate the data for a

Re: [GENERAL] Reassign value of IN parameter in 9.1.1

2011-11-24 Thread Alban Hertroys
On 24 November 2011 14:52, Gavin Casey gpjca...@googlemail.com wrote: This works in 9.1.1 but seems like a bug to me: create function xout(_x INTEGER) returns integer as $$ begin    _x = _x * 2; I would expect an error here, as having an expression without a context (an if-statement, for

Re: [GENERAL] How to lock and unlock table in postgresql

2011-11-16 Thread Alban Hertroys
have a naming conflict between your variable name and a column name in that second query: id and Id are the same. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] : Postgres installation error on CentOS

2011-11-15 Thread Alban Hertroys
On 15 November 2011 12:58, Venkat Balaji venkat.bal...@verse.in wrote: Hello, We are facing an issue while installing Postgres-9.0.1 on CentOS-5. That name always makes me wonder when they're releasing PennyOS or DollarOS :P Below is the error we are encountering - ./configure -- output

Re: [GENERAL] Returning a row from a function with an appended array field

2011-11-10 Thread Alban Hertroys
On 10 November 2011 02:54, Wes Cravens wcrav...@cortex-it.com wrote: On 11/9/2011 7:34 PM, David Johnston wrote: Use WITH RECURSIVE instead of a function. I apologize but I don't know how that would work.  An example would help. There are fine examples in the documentation for the SELECT

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-11-10 Thread Alban Hertroys
On 10 November 2011 08:56, Kalai R softlinne...@gmail.com wrote: please suggest, what are the configurations should I do in postgres to avoid these problem. Thank You None, it's not a Postgres problem. Most likely it is a problem with your Windows installation. You have files disappearing,

Re: [GENERAL] How to inquiry a nest result?

2011-11-10 Thread Alban Hertroys
On 10 November 2011 15:43, shuaixf shua...@gmail.com wrote: --*Test SQL* CREATE TABLE tb(id integer primary key,                name varchar(32),                parent integer); INSERT INTO tb VALUES(1, 'iPhone',    NULL); INSERT INTO tb VALUES(2, 'HTC',       NULL); INSERT INTO tb

Re: [GENERAL] troubleshooting PGError

2011-11-10 Thread Alban Hertroys
On 9 November 2011 06:02, slavix mikerin.sl...@gmail.com wrote: Hello, I am new to postgres, but need to resolve this error: PGError: ERROR:  current transaction is aborted, commands ignored until end of transaction block : SELECT  1 FROM trades  WHERE (trades.uuid =

Re: [GENERAL] troubleshooting PGError

2011-11-10 Thread Alban Hertroys
documentation at: http://www.postgresql.org/docs/8.3/static/tutorial-transactions.html P.S. Please don't top-post on this list. P.P.S. And please include the list in your replies (reply all). On Thu, Nov 10, 2011 at 8:30 AM, Alban Hertroys haram...@gmail.com wrote: On 9 November 2011 06:02, slavix

Re: [GENERAL] Returning a row from a function with an appended array field

2011-11-10 Thread Alban Hertroys
... WITH RECURSIVE would be handy for something like get_ancestors or get_descendents. If you only need one level of recursion, you can just use a self-join. SELECT parent.id AS parent_id, child.id as child_id FROM thingy AS parent LEFT OUTER JOIN thingy AS child ON (child.parent_id = parent.id) Alban

Re: [GENERAL] Strange problem with create table as select * from table;

2011-11-03 Thread Alban Hertroys
On 3 November 2011 15:15, hubert depesz lubaczewski dep...@depesz.com wrote: Do the xobject_id values have other negative numbers or is -1 just a special case? The only thing I can think of is a corrupted index on xobject_id. minimal xobject_id in source table is 1000. index on xobject_id

Re: [GENERAL] Strange problem with create table as select * from table;

2011-11-03 Thread Alban Hertroys
On 3 November 2011 09:25, hubert depesz lubaczewski dep...@depesz.com wrote: All looks good. pg_dump of the table also doesn't show any strange problems, and is duplicate free. But: $ create table zzz as select * from sss.xobjects; SELECT $ select xobject_id, count(*) from zzz group by

Re: [GENERAL] Why is there no 8.3.16 rpm with _id ?

2011-10-31 Thread Alban Hertroys
2011/10/30 Devrim GÜNDÜZ dev...@gunduz.org: I have no intention to build the -id packages again, given the lack of request (first request since 8.3.11...). You can build your own packages quite easily, though. But... aren't integer datetimes supposed to be the default, with float datetimes

Re: [GENERAL] From select to delete

2011-10-29 Thread Alban Hertroys
referenced from table pref_scores. CONTEXT: SQL statement delete from pref_games where gid in (select gid from pref_scores where id= $1 ) It would without cascades defined, yeah. Did you skip over the first paragraph of David's reply? Alban Hertroys -- If you can't see the forest for the trees

Re: [GENERAL] Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!

2011-10-28 Thread Alban Hertroys
On 28 October 2011 09:02, Mohamed Hashim nmdhas...@gmail.com wrote: EXPLAIN select * from stk_source ; QUERY PLAN -  Result  (cost=0.00..6575755.39 rows=163132513 width=42)

Re: [GENERAL] Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!

2011-10-28 Thread Alban Hertroys
On 28 October 2011 13:37, Alban Hertroys haram...@gmail.com wrote: On 28 October 2011 09:02, Mohamed Hashim nmdhas...@gmail.com wrote: Please don't cross-post to mailing lists for multiple projects. -- If you can't see the forest for the trees, Cut the trees and you'll see there is no forest

Re: [GENERAL] From select to delete

2011-10-28 Thread Alban Hertroys
INTO. CONTEXT: compilation of PL/pgSQL function pref_delete_user near line 3 SELECT INTO in PL/pgSQL isn't the same command as SELECT INTO in SQL. Check the documentation for the two ;) Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general

Re: [GENERAL] Saving score of 3 players into a table

2011-10-26 Thread Alban Hertroys
On 26 October 2011 10:08, Alexander Farber alexander.far...@gmail.com wrote:    create table pref_games {            gid serial,            rounds integer not null,            finished timestamp default current_timestamp    } then how do I find the new game id after I've just created it

Re: [GENERAL] [pgadmin-support] Help for Migration

2011-10-24 Thread Alban Hertroys
there is even a section named Calling functions, but it seems to focus on writing functions instead. Alban Hertroys -- The scale of a problem often equals the size of an ego. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

<    1   2   3   4   5   6   7   8   9   10   >