[GENERAL] public schema owner for newly created database

2014-04-08 Thread Thomas Kellerer
Hello all, I usually create new databases with an explicit owner which is the application user that is used by the application to connect to the database. I recently noticed when I do the following: postgres=# create user arthur identified by 'secret'; postgres=# create database guide owner =

Re: [GENERAL] public schema owner for newly created database

2014-04-08 Thread Thomas Kellerer
Alberto Cabello Sánchez, 08.04.2014 13:05: But I would have expected the owner of the database to be the owner of any object that is created during database initialization. Do I have a wrong assumption here? It seems you do. See: Why Postgresql Public Schema Is Not Owned By The DB

Re: [GENERAL] COPY v. java performance comparison

2014-04-03 Thread Thomas Kellerer
Rob Sargent, 02.04.2014 21:37: I loaded 37M+ records using jOOQ (batching every 1000 lines) in 12+ hours (800+ records/sec). Then I tried COPY and killed that after 11.25 hours when I realised that I had added on non-unque index on the name fields after the first load. By that point is was on

[GENERAL] Re: Is PostgreSQL 9.3 using indexes for pipelined top-N window function queries?

2014-03-14 Thread Thomas Kellerer
. The execution plan from Thomas Kellerer sees to fulfill requirement (1) but definitively not (2). Even with 9.3.2, I were not able to reproduce the result of Thomas (not showing any sort operation in the execution plan) with the test data I also published at my website: http://use-the-index-luke.com

Re: [GENERAL] multiple results from a function

2014-03-03 Thread Thomas Kellerer
James Harper wrote on 03.03.2014 21:10: I'm working on an application to accept TDS (Microsoft SQL Server) connections and proxy them to postgres. MSSQL does things a little differently, for instance in addition to a functions it has stored procedures that can contain multiple select statement

Re: [GENERAL] Moving data from M$ JetDB file to Postgres on Linux

2014-02-28 Thread Thomas Kellerer
Rich Shepard wrote on 01.03.2014 00:21: I just downloaded two scientific data files from a federal agency's Web site. Both are in M$ JetDB format. I run only linux and keep all my scientific dat in postgres. My Web search did not turn up anything useful; the closest was a thread from this

Re: [GENERAL] Moving data from M$ JetDB file to Postgres on Linux

2014-02-28 Thread Thomas Kellerer
Rich Shepard wrote on 01.03.2014 01:33: On Sat, 1 Mar 2014, Thomas Kellerer wrote: It's not clear to me what exactly you are trying to do. Or are you just trying to copy the data into the Postgres database? If the latter you could try one of the JDBC based query tools to export or copy

Re: [GENERAL] configuration error

2014-02-20 Thread Thomas Kellerer
saravanan Chow, 20.02.2014 06:41: There is nothing in the pg_log. Log files contains : 2014-02-20 10:58:55 IST LOG: received fast shutdown request 2014-02-20 10:58:55 IST LOG: aborting any active transactions 2014-02-20

[GENERAL] Re: Is PostgreSQL 9.3 using indexes for pipelined top-N window function queries?

2014-02-17 Thread Thomas Kellerer
Behrang Saeedzadeh, 15.02.2014 02:35: Hi, I just stumbled upon this article from 2012 [1], according to which (emphasis mine): Window functions offer yet another way to implement pagination in SQL. This is a flexible, and above all, standards-compliant method. However, only SQL Server

Re: [GENERAL] client that supports editing views

2014-02-08 Thread Thomas Kellerer
Stefan Keller wrote on 08.02.2014 12:31: If pgAdmin is acceptable, you might want to try SQL Workbench/J: http://www.sql-workbench.net I'd like to revive that discussion and like to know: Q1 = Can anybody recommend a desktop GUI tool (preferrably open source) for PG with customizable forms

Re: [GENERAL] Grep'ing for a string in all functions in a schema?

2014-01-30 Thread Thomas Kellerer
Wells Oliver wrote on 30.01.2014 21:45: Since Postgres does not consider a table as a dependency of a function if that table is referenced in the function (probably a good reason), I often find myself in a position of asking is this table/sequence/index referenced in any of these N number of

Re: [GENERAL] concurrent SELECT blocking ALTER?

2014-01-29 Thread Thomas Kellerer
Neil Harkins wrote on 29.01.2014 23:37: I totally understand DDL taking exclusive locks, the problem here seems to be that the *SELECTs* are taking out exclusive locks, locking out the ALTER, which feels like a bug. The SELECT is not holding an exclusive lock, it's holing a *shared* lock, but

Re: [GENERAL] Fully-automatic streaming replication failover when master dies?

2014-01-23 Thread Thomas Kellerer
Dmitry Koterov, 22.01.2014 22:35: I googled 1 hour approximately, but have not found a ready solution for this. So maybe this feature is in PostgreSQL todo-list, or something similar exists somewhere... Before the actual question, I'd like to give a small analogy. What I mostly love in

Re: [GENERAL] composite foreign key performance

2014-01-22 Thread Thomas Kellerer
Leonard Boyce, 22.01.2014 16:49: We have an existing schema as follows; lookup (id bytea PK, status text, .) data A bytea as the PK? That sounds horrible. Hoping I can get some advice here. What exactly is your question? -- Sent via pgsql-general mailing list

[GENERAL] to_date() and invalid dates

2014-01-20 Thread Thomas Kellerer
Hi, I asked this a while back already: select to_date('2013-02-31', '-mm-dd'); will not generate an error (unlike e.g. Oracle) However in the release notes of 9.2.3[1] it is mentioned that - Reject out-of-range dates in to_date() (Hitoshi Harada) I tried the above statement using

Re: [GENERAL] to_date() and invalid dates

2014-01-20 Thread Thomas Kellerer
Albe Laurenz, 20.01.2014 15:29: I asked this a while back already: select to_date('2013-02-31', '-mm-dd'); will not generate an error (unlike e.g. Oracle) This is by design. When I previously asked this question the answer as this is based on Oracle's to_date():

Re: [GENERAL] to_date() and invalid dates

2014-01-20 Thread Thomas Kellerer
Michael Nolan, 20.01.2014 16:17: Thomas, try this: '2013-02-31'::date Thanks, I know this works, but this can't be used if you have a non-ISO date string -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Add PK constraint to a Unique Index via updating system catalogs?

2014-01-06 Thread Thomas Kellerer
CS DBA wrote on 06.01.2014 23:30: We have a few very large tables with unique indexes on a column but the column is not defined as the Primary Key. Can we add a PK constraint via updates to the system catalogs so we can avoid the lengthy checks that would take place if we ran alter table add

Re: [GENERAL] replacing expresion in plpgsql

2013-12-15 Thread Thomas Kellerer
John R Pierce, 16.12.2013 01:23: select current_timestamp, current_timestamp + interval '2' day; that should be interval '2 day' (note the ' moved), and for a variable number passed as a parameter, try... Both are valid. interval '2' day is the ANSI SQL format though. -- Sent

Re: [GENERAL] client that supports editing views

2013-12-10 Thread Thomas Kellerer
Willy-Bas Loos, 10.12.2013 13:30: cool, SQL Workbench/J: does the job. It's too bad that it doesn't list the lables/views, so that you can't just open them with a click (i use select * from table to get the data), but it works well. Did you check the Database Explorer?

Re: [GENERAL] client that supports editing views

2013-12-09 Thread Thomas Kellerer
Willy-Bas Loos, 09.12.2013 14:36: I have a database with views that have rules on them, so that users can do insert/update/delete on their part of the data. The rules ore do instead rules that redirect the edits to the table that actually holds the data, on which the users have no rights.

Re: [GENERAL] client that supports editing views

2013-12-09 Thread Thomas Kellerer
Willy-Bas Loos wrote on 09.12.2013 21:44: But the option to save the record is disabled, the other 2 buttons do not enable me to save the record. Anyway, i don't care much for MS Access, any client will do (that is, if it costs money, it would be nice if most users own it already or it isn't

Re: [GENERAL] Full Stored Procedure Support, any time soon ?

2013-11-30 Thread Thomas Kellerer
Alban Hertroys wrote on 30.11.2013 22:34: - Multiple result sets Since you’re talking about procedures, you can’t possibly mean that those return multiple result sets? Yes, basically something like this: create procedure foobar() begin select * from table_1; select * from table_2 end;

Re: [GENERAL] Full Stored Procedure Support, any time soon ?

2013-11-30 Thread Thomas Kellerer
John R Pierce wrote on 30.11.2013 23:47: On 11/30/2013 2:30 PM, Noel Diaz wrote: This might involve the control of transaction state and the return of multiple result sets * PL/pgSQL stored procedure returning multiple result sets (SELECTs)?

Re: [GENERAL] Inserting rows containing composite foreign keys

2013-11-25 Thread Thomas Kellerer
Nelson Green, 25.11.2013 23:01: Hello, When inserting a record into the jobs table that references projects by name, do I have to query the projects table twice, once to get the funding source number, and once to get the project sequence number, even though both results will return the

Re: [GENERAL] Solution for Synonyms

2013-11-22 Thread Thomas Kellerer
mrprice22 wrote on 22.11.2013 19:25: We are in the process of moving from Oracle to PostgreSQL. We use a stored procedure to populate some reporting tables once an hour. There are two sets of these tables, set A and set B. We use synonyms to point to the “active” set of tables at any given

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Thomas Kellerer
bsreejithin, 05.11.2013 10:04: We have a csv file which we upload into postgres DB. If there are some errors, like a data mismatch with the database table columns, postgres should raise and error and upload should fail. What is happening now is that, in case we get some junk date in the

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Thomas Kellerer
bsreejithin, 05.11.2013 13:14: Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png It would have much easier if you had simply used copy paste to post a text version of

Re: [GENERAL] Unique - first

2013-10-27 Thread Thomas Kellerer
Robert James wrote on 27.10.2013 14:04: I have a table (x,y,z) - I'd like to take the rows with unique x values - but, when more than one row have the same x value, I want the one with the minimal z value. How can I do that? I can imagine doing it with window functions, but also that regular

Re: [GENERAL] Work table

2013-10-27 Thread Thomas Kellerer
Robert James wrote on 27.10.2013 20:47: I'm using Postgres for data analysis (interactive and batch). I need to focus the analysis on a subset of one table, and, for both performance and simplicity, have a function which loads that subset into another table (DELETE FROM another_table; INSERT

Re: [GENERAL] need elegant way to store and query tables with variable headers

2013-10-08 Thread Thomas Kellerer
Gauthier, Dave wrote on 08.10.2013 20:27: Someone is asking me for a way to architect a model which will store basic table data (columns with names and rows), but the number and name of the columns are both variables. I'll call these data-tables here. sounds like the hstore extension could

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Thomas Kellerer
Patrick Dung wrote on 13.09.2013 18:17: The problem of pg_upgrade is that it needed to hold two set of databases data in the server. This is not be desirable (very slow) or possible (space limitation) for database with huge data. For example, if the old version is already using over 50% of

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-12 Thread Thomas Kellerer
Merlin Moncure wrote on 12.09.2013 18:37: By the way, for in-place major version upgrade (not dumping DB and import again), MySQL is doing a better job in here. http://www.postgresql.org/docs/9.3/static/pgupgrade.html pgupgrade has nothing to do with this: that's just a tool that does in

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-12 Thread Thomas Kellerer
Patrick Dung wrote on 12.09.2013 18:11: For PostgreSQL, it seems I can't find the list (it just say see the Appendix E / release notes). I think it is a plus for PostgreSQL if it has few incompatibilities between major versions. There is such a list in the release notes:

Re: [GENERAL] How To Install Extension Via Script File?

2013-08-08 Thread Thomas Kellerer
Don Parris wrote on 08.08.2013 23:13: And to be able to run it from the Bash prompt (as securely as possible). I thought I could add the commands and run the create script by doing: sudo -u postgres psql -U user -W -d mydb --file=/home/user/dev/mydb_create.sql I thought that, running my

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

2013-08-05 Thread Thomas Kellerer
Stephen Brearley, 02.08.2013 11:40: I can change my registry reference to point to D:\..\9.2\data or D:\..\9.2\data_old without any (apparently) undesirable consequences, but I just can’t see my tables in the system, which makes me think I need to do more than this. Why don't you use the

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

2013-08-01 Thread Thomas Kellerer
Alban Hertroys, 31.07.2013 15:16: I suspect the postgres log is either in the Windows Event Log (available from the Control Panel, perhaps under Administrative Tools or something similar) or in a file somewhere in the Postgres installation directory, most likely in a directory named log. It's

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

2013-08-01 Thread Thomas Kellerer
hidayat...@gmail.com, 31.07.2013 15:52: As per my experience, installing postgresql on windows machine automatically create postgres user. When you uninstall it, the postgres user doesn't automatically removed, you must remove it manually. Not any more. Since 9.1 (or was it 9.2?) Postgres

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

2013-07-29 Thread Thomas Kellerer
Stephen Brearley wrote on 29.07.2013 21:23: 1.Explain why my bug report has not been responded to Because it's not a bug as you simply upgraded incorrectly. 5.Tell me how I should uninstall Postgres, if I am doing this wrong You did run the Uninstall, did you? 6.Tell me how to remove any

Re: [GENERAL] new instance of postgres on windows

2013-07-19 Thread Thomas Kellerer
John R Pierce, 18.07.2013 21:20: If you want to install a completely new instance, just put it into a different directory, and given the service a different name. Newer Postgres versions don't need a dedicated Windows user account any more. I usually don't use the installer any more, but

Re: [GENERAL] new instance of postgres on windows

2013-07-18 Thread Thomas Kellerer
Arvind Singh wrote on 18.07.2013 12:22: I want to install postgresql for use as the backend to a Windows application. This seems to be no problem if postgresql is NOT already installed on the system. which is not in this case. postgresql is already installed and unless the command line

Re: [GENERAL] cron tasks in pg 9.3

2013-07-18 Thread Thomas Kellerer
Joe Van Dyk wrote on 18.07.2013 23:23: Will the custom worker support in 9.3 let me put cron-like tasks into postgresql? I have a lot of database functions that should run every few seconds, every minute, every hour, once a week, etc. Right now, I always have to have exactly one machine setup

Re: [GENERAL] dynamic table names

2013-07-17 Thread Thomas Kellerer
John Smith wrote on 17.07.2013 22:39: guys, have to use legacy 8.1. i have 100,000 tables in a schema that need to be queried (optimizing this by combining them into one will have to wait). so my query goes like so: execute 'select * from ' || tabname::regclass || ' where firstname =

Re: [GENERAL] Triggers

2013-07-05 Thread Thomas Kellerer
itishree sukla, 05.07.2013 10:29: Hello Every one, Is Postgresql providing triggers on DB level, schema level ( in same DB)? You are probably referring to DDL triggers and similar things (a trigger when a table is created or dropped, a user logs in and so on). The answer is no as far as I

Re: [GENERAL] Triggers

2013-07-05 Thread Thomas Kellerer
Thomas Kellerer, 05.07.2013 13:46: Postgres 9.3 will add event triggers, but they can only be written in SQL That should have been: only C and procedural languages like PL/pgSQL -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] My function run successfully with cursor, but can't change table

2013-06-10 Thread Thomas Kellerer
Kevin Grittner wrote on 10.06.2013 15:19: It has nothing to do with the way you are using the cursor; your problem is that you are causing an error by attempting to COMMIT inside a function (which is not allowed). This rolls back the subtransaction defined by the BEGIN/EXCEPTION block. You

Re: [GENERAL] Function tracking

2013-06-07 Thread Thomas Kellerer
Rebecca Clarke wrote on 07.06.2013 12:30: I'm looking for suggestions on the best way to track the updates to a function. We have two databases, Dev Live, so I want to update Live with just the functions that have been modified in the DEV databas3e. Is there another, easier way to track the

Re: [GENERAL] Load Mysql table CSV into postgresql

2013-06-06 Thread Thomas Kellerer
Adarsh Sharma wrote on 06.06.2013 19:33: Hi, Today i need to load some mysql ( 5.1.58 ) tables dump in postgresql ( PG 9.2 ). I loaded few tables successfully but while loading one table i am facing below error : After some research , i think it is failing because Mysql table has character

Re: [GENERAL] Synonyms in PostgreSQL 9.2.4

2013-06-05 Thread Thomas Kellerer
Panneerselvam Posangu, 05.06.2013 11:30: Currently our application works along with Oracle 11g. In Oracle schema we have created Synonyms. The context is this: In Oracle schema we have couple of users. They own tables, views, and other objects. We create synonyms for a given object ,grant needed

Re: [GENERAL] upsert functionality

2013-05-16 Thread Thomas Kellerer
Sajeev Mayandi, 16.05.2013 07:01: Hi, Our company is planning to move to postreSQL. We were initially using sybase where upsert functionality was available using insert on existing update clause. I know there multiple ways to fix this using RULE or separate function in postgresql. But I would

[GENERAL] 9.3 beta and materialized views

2013-05-16 Thread Thomas Kellerer
Hi, I'm currently adding the support for materialized views to my SQL tool, and noticed that when creating a materialized view, a rewrite rule is also created that looks just like a rewrite rule for a normal view. Using pg_get_ruledef() I see that the rule is defined like this: REATE RULE

Re: [GENERAL] 9.3 beta and materialized views

2013-05-16 Thread Thomas Kellerer
Tom Lane wrote on 16.05.2013 19:36: As the materialized view should be a table that can be selected from, I wonder what the purpose of the rewrite rule is? To store the matview's definition for use in REFRESH. Ah, right. Makes sense. Thanks for the quick reply. -- Sent via

Re: [GENERAL] Storing small image files

2013-05-10 Thread Thomas Kellerer
Nelson Green wrote on 09.05.2013 19:05: On Thu, May 9, 2013 at 10:51 AM, Achilleas Mantzios wrote: then here : http://www.dbforums.com/postgresql/1666200-insert-jpeg-files-into-bytea-column.html Thanks Achilleas. I usually do the physical design in vi using sql scripts, and I like to include a

Re: [GENERAL] Implementing DB2's distinct types

2013-04-29 Thread Thomas Kellerer
Simon Riggs, 28.04.2013 21:42: On 21 April 2013 12:17, Thomas Kellerer spam_ea...@gmx.net wrote: DB2 lets you define your own types (just as Postgres) but with the added benefit that you can mark them such that they are _not_ comparable, e.g. to avoid comparing apples to oranges. Sounds like

Re: [GENERAL] Implementing DB2's distinct types

2013-04-22 Thread Thomas Kellerer
create type sno as varchar(50) with comparisons; create type pno as varchar(50) with comparisons; The following query will be rejected because sno and pno are not comparable (even though both are varchar columns): select * from p join s on s.sno = p.pno; I wonder if a similar

Re: [GENERAL] bug in 8.4 and resolved

2013-04-22 Thread Thomas Kellerer
Abhinav Dwivedi wrote on 22.04.2013 07:12: select * from district where statecode in (Select districtcode from state) Please note that the attribute districtcode is not existent in the table state and if this query i.e. Select districtcode from state is executed in isolation then it correctly

[GENERAL] Implementing DB2's distinct types

2013-04-21 Thread Thomas Kellerer
Hi, I recently stumbled upon a really cool feature in DB2: distinct types. DB2 lets you define your own types (just as Postgres) but with the added benefit that you can mark them such that they are _not_ comparable, e.g. to avoid comparing apples to oranges. Take the following example:

Re: [GENERAL] how to find which tables required indexes in postgresql

2013-04-10 Thread Thomas Kellerer
Zahid Quadri, 10.04.2013 13:31: hi,, please suggest if there is any way which i can find which tables need indexes in postgresql. Tables don't need indexes. Queries do. You will need to show us the queries in question (e.g. those that are slow) in order to decide which index is helpful.

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-10 Thread Thomas Kellerer
Condor, 10.04.2013 15:03: Hello ppl, I have a database where the previous owner use US date format in date fields: 2009-02-18 Is there a way how to convert the fields in European format 18-02-2009. I mean existing date in records. What's will be happened if I change format in postgresql.conf

Re: [GENERAL] How to convert US date format to European date format ?

2013-04-10 Thread Thomas Kellerer
John R Pierce wrote on 10.04.2013 21:28: On 4/10/2013 6:15 AM, Thomas Kellerer wrote: psql (one of the possible client applications) uses the datestyle parameter to decide on how to format a date column when displaying it. If you change the datestyle parameter in postgresql.conf

Re: [GENERAL] Why does Postgres allow duplicate (FK) constraints

2013-03-27 Thread Thomas Kellerer
Tom Lane, 26.03.2013 17:16: The lack of any prohibition to the contrary means there is no way to argue that the code you showed previously violates the spec; thus, a database that fails to accept it is rejecting spec-compliant DDL. I'm not claiming that the spec is violated... (And I'm not

Re: [GENERAL] Why does Postgres allow duplicate (FK) constraints

2013-03-27 Thread Thomas Kellerer
Alban Hertroys, 26.03.2013 17:17: It can make sense during a maintenance window, if you create a new (redundant) FK constraint concurrently to replace the existing one. If you'd first remove the existing constraint, you're allowing FK violations until the new constraint has finished creating its

[GENERAL] Why does Postgres allow duplicate (FK) constraints

2013-03-26 Thread Thomas Kellerer
Hi, I was a bit surprised that the following DDL will work: create table parent (id integer not null primary key); create table child (id integer not null primary key, pid integer not null); alter table child add constraint fk_child_parent foreign key (pid) references parent(id);

Re: [GENERAL] Why does Postgres allow duplicate (FK) constraints

2013-03-26 Thread Thomas Kellerer
Tom Lane, 26.03.2013 17:03: While I agree that this SQL should not have been written like this in the first place, I wonder why Postgres doesn't actively prevent this (like e.g. Oracle). If Oracle does that, they're violating the SQL standard --- there is nothing in the standard that supports

Re: [GENERAL] File Fragmentation

2013-03-20 Thread Thomas Kellerer
jg, 20.03.2013 12:13: I suspect the heavy fragmented files to the cause of the IO wait grows (PostgreSQL on WIndows). How to cope with that? I would first investigate that it's *really* the fragmentation. As a database does a lot of random IO, fragmentation isn't such a big issue. You could

Re: [GENERAL] DB design advice: lots of small tables?

2013-03-15 Thread Thomas Kellerer
Kevin Grittner, 15.03.2013 14:36: soapbox-rant I occasionally hear someone maintaining that having a meaningless sequential ID column as the primary key of each table is required by the relational model. At those moments I swear I can actually hear E.F. Codd turning in his grave. It was a

Re: [GENERAL] table dump function

2013-03-07 Thread Thomas Kellerer
Adrian Klaver wrote on 07.03.2013 19:18: Not that I know of. If you feel adventurous you could look at dumpTableSchema in pg_dump.c in the source to see how pg_dump does it. I think a function pg_get_tabledef() would be very helpful. We already have a lot of pg_get_XXXdef() functions

Re: [GENERAL] how long to wait on 9.2 bitrock installer?

2013-02-28 Thread Thomas Kellerer
Adrian Klaver wrote on 28.02.2013 20:45: 9.2.3, Was running overnight for 17 hours. Cancelled install. May investigate further. Installing to Windows. Would seem to be a question for the folks at BitRock: http://bitrock.com/about.html I'm pretty sure that is the call of setacl.exe again -

Re: [GENERAL] PostgreSQL Live CD for 9.2.3 released

2013-02-27 Thread Thomas Kellerer
Devrim GÜNDÜZ, 21.02.2013 11:48: Please let me know if you have any questions regarding this live CD. Thanks for the work! I have booted a VirtualBox system from the live CD. Can I convert this to a real system? The homepage mentions Option to install image to hard drive but I can't find

Re: [GENERAL] Visual query builder for PosgreSQL?

2013-02-18 Thread Thomas Kellerer
Satoshi Nagayasu, 17.02.2013 17:42: I have never seen InstantSQL itself, but I had chances several times to go the RDB technical seminars here in Japan, where I have found that learning database technology is really exciting. :) So, I wish I will be able to work with RDB (and VMS) someday. :)

Re: [GENERAL] Visual query builder for PosgreSQL?

2013-02-16 Thread Thomas Kellerer
Gauthier, Dave wrote on 16.02.2013 17:04: Many, many (many) years ago, while working at DIGITAL EQUIPMENT (before it bellied up), I worked with a relational DB they created called RDB. RDB/VMS was actually the first relational database I ever worked with. Boy, is that a long time ago...

Re: [GENERAL] How to store version number of database layout

2013-02-12 Thread Thomas Kellerer
Frank Lanitz, 12.02.2013 11:01: It's more like a question of best practice: How do you managing different version of database layout for e.g. software releases? We are planing to do an application based on postgres and want to store some version number of database layout to ensure correct

[GENERAL] Re: feature requests (possibly interested in working on this): functional foreign keys

2013-02-07 Thread Thomas Kellerer
Geoff Winkless, 07.02.2013 11:46: On 7 February 2013 09:38, Chris Travers chris.trav...@gmail.com mailto:chris.trav...@gmail.com wrote: 1: The foreign key depends on the function so the function cannot be dropped first absent CASCADE 2: If the function is redefined, one would have to check

Re: [GENERAL] DEFERRABLE NOT NULL constraint

2013-02-05 Thread Thomas Kellerer
Andreas Joseph Krogh, 05.02.2013 10:57: The value of having NOT NULL deferrable is, well, to not check for NULL until the tx commits. When working with ORMs this often is the case, especially with circular FKs. With circular FKs it's enough to define the FK constraint as deferred. -- Sent

Re: [GENERAL] DEFERRABLE NOT NULL constraint

2013-02-05 Thread Thomas Kellerer
Andreas Joseph Krogh, 05.02.2013 11:15: Andreas Joseph Krogh, 05.02.2013 10:57: The value of having NOT NULL deferrable is, well, to not check for NULL until the tx commits. When working with ORMs this often is the case, especially with circular FKs. With circular FKs

Re: [GENERAL] Diferences between IN and EXISTS?

2013-02-04 Thread Thomas Kellerer
zeljko, 04.02.2013 10:35: Edson Richter wrote: Hi! Assumptions: PostgreSQL 9.2.2, Win64, already run vacumm full freeze analyze. No problems in the database. I know there are 1247 records to be found. Why does these queries return different results: select count(*) from parcela where id not

[GENERAL] Windows documentation

2013-02-01 Thread Thomas Kellerer
Hi, I just noticed that on this page: http://www.postgresql.org/docs/current/static/install-windows.html it states Native builds of psql don't support command line editing which is clearly not true. psql (at least with 9.2.x but I'm pretty sure this has been working in older

Re: [GENERAL] database design best pratice help

2013-01-28 Thread Thomas Kellerer
I'll answer with the same things I did on the Oracle list :) code description To avoid to have a so great number of similar tables in the db I wonder if it is a good idea to unify all these tables in one big table like this: id code table_ name description The advantages are: 1. only one

Re: [GENERAL] seeking SQL book recommendation

2013-01-23 Thread Thomas Kellerer
Scott Ribe wrote on 23.01.2013 23:56: For a client who needs to learn how to query the db: - No SQL knowledge at all; needs to start from square 1. - Smart, capable person, who will be in this position for a long time, using this db for a long time. - No chance in hell this db will be moved

Re: [GENERAL] seeking SQL book recommendation

2013-01-23 Thread Thomas Kellerer
John R Pierce wrote on 24.01.2013 00:19: - No SQL knowledge at all; needs to start from square 1. - Smart, capable person, who will be in this position for a long time, using this db for a long time. - No chance in hell this db will be moved off PG, so PG-centric is fine I can't recommend

Re: [GENERAL] Case insensitive collation

2013-01-21 Thread Thomas Kellerer
Marcel van Pinxteren, 21.01.2013 13:22: As I mentioned in my original post, I don't want to use citext or lower(). Why not for the unique index/constraint? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Case insensitive collation

2013-01-21 Thread Thomas Kellerer
Marcel van Pinxteren wrote on 21.01.2013 17:25: The other reason, is that I assume that lower() adds overhead It won't add any noticeable overhead for the unique index. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Case insensitive collation

2013-01-18 Thread Thomas Kellerer
Marcel van Pinxteren, 18.01.2013 14:13: Desired behaviour: 1. If there is a row with 'ABC' (in a unique column) in the table, a row with 'abc' should not be allowed That's an easy one: create unique index on foo (lower(the_column)); -- Sent via pgsql-general mailing list

Re: [GENERAL] spring a string to rows (Postgresql 8.4)

2013-01-07 Thread Thomas Kellerer
Emi Lu wrote on 07.01.2013 20:44: Hello, Is there a function to split a string to different rows? For example, t1(id, col1) values(1, 'a, b, c'); select id, string_split_to_row(col1, ','); Return: = 1, a 1, b 1, c Thanks alot! Emi select id, regexp_split_to_table(col1, ',')

Re: [GENERAL] Counterintuitive locking behavior

2013-01-06 Thread Thomas Kellerer
Chris Travers wrote on 06.01.2013 03:18: i.e. where on UPDATE foo, all rows selected from foo during the update are locked unless the subselect specifically states otherwise. That would strike *me* as wrong. The UPDATE should only lock the rows that were actually updated, not those that were

Re: [GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-03 Thread Thomas Kellerer
Robert Klaus wrote on 03.01.2013 16:50: We have 36,000+ rows returned by SELECT oid, format_type(oid, typtypmod) AS typname FROM pg_type. My manager says this is only a small number compared to what is expected by next summer. Why do you need so many types? That sounds like something in your

Re: [GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-03 Thread Thomas Kellerer
Robert Klaus wrote on 03.01.2013 18:45: Yes, I consider it a tool issue and not a database issue. Is there somewhere else I should be posting this to? There is a pgAdmin mailing list, see here: http://www.postgresql.org/community/lists/ Thomas -- Sent via pgsql-general mailing list

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-17 Thread Thomas Kellerer
Edson Richter wrote on 14.12.2012 00:52: I was wondering to create a tool for diagramming and database forward engineering. There are already few tools around. If you know a good diagramming tool able to database diff and forward engineering (with ALTER ..., not DROP and CREATE), I would

Re: [GENERAL] JDBC to load UTF8@psql to latin1@mysql

2012-12-13 Thread Thomas Kellerer
Emi Lu wrote on 13.12.2012 15:00: Is there a simple way to load UTF8 data in psql to mysql(with latin1 encoding) through JDBC? All you need to do is to query the source database, then use ResultSet.getString() to obtain the data and use a PreparedStatement and PreparedStatement.setString()

Re: [GENERAL] JDBC to load UTF8@psql to latin1@mysql

2012-12-12 Thread Thomas Kellerer
Emi Lu wrote on 12.12.2012 17:17: Good morning, Is there a simple way to load UTF8 data in psql to mysql(with latin1 encoding) through JDBC? All you need to do is to query the source database, then use ResultSet.getString() to obtain the data and use a PreparedStatement and

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

2012-12-10 Thread Thomas Kellerer
Zbigniew, 10.12.2012 04:20: Yes, I read about using savepoints - but I think we agree, it's just cumbersome workaround - and not real solution, I disagree. It might be a bit cumbersome, but it *is* a proper solution to the problem - not a workaround. Thomas -- Sent via pgsql-general

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

2012-12-10 Thread Thomas Kellerer
Chris Angelico, 10.12.2012 16:47: The other part of the problem is that you're using transactions for something other than transactional integrity. You're batching up transactions in order to improve performance. That's certainly possible, but you're using the database oddly, so you can't expect

[GENERAL] ERROR: unrecognized object class: 1262 with 9.2.2 but not with 9.2.1

2012-12-09 Thread Thomas Kellerer
I recently upgraded from 9.2.1 to 9.2.2 and my unit tests for my application are failing when cleaning up my test database. I am using the statement: drop owned by wbjunit cascade; at the end of a test suite to get rid of everything that was created during the tests. Now since the

[GENERAL] Re: ERROR: unrecognized object class: 1262 with 9.2.2 but not with 9.2.1

2012-12-09 Thread Thomas Kellerer
Thomas Kellerer wrote on 09.12.2012 11:36: I recently upgraded from 9.2.1 to 9.2.2 and my unit tests for my application are failing when cleaning up my test database. I am using the statement: drop owned by wbjunit cascade; at the end of a test suite to get rid of everything

[GENERAL] Re: ERROR: unrecognized object class: 1262 with 9.2.2 but not with 9.2.1

2012-12-09 Thread Thomas Kellerer
Jeff Janes, 09.12.2012 23:41: On Sun, Dec 9, 2012 at 2:36 AM, Thomas Kellerer spam_ea...@gmx.net wrote: I recently upgraded from 9.2.1 to 9.2.2 and my unit tests for my application are failing when cleaning up my test database. I am using the statement: drop owned by wbjunit cascade

[GENERAL] Re: ERROR: unrecognized object class: 1262 with 9.2.2 but not with 9.2.1

2012-12-09 Thread Thomas Kellerer
Jeff Janes, 09.12.2012 23:41: I recently upgraded from 9.2.1 to 9.2.2 and my unit tests for my application are failing when cleaning up my test database. I am using the statement: drop owned by wbjunit cascade; at the end of a test suite to get rid of everything that was created during

Re: [GENERAL] youtube video on pgsql integrity

2012-11-29 Thread Thomas Kellerer
Kevin Grittner, 29.11.2012 15:27: Ray Stell wrote: http://www.youtube.com/watch?v=1PoFIohBSM4 I really don't want to get into bashing another product or starting a flame war, but I'm curious -- is everything shown there really the behavior of the MySQL database itself? Yes, it is. It *is*

Re: [GENERAL] Determine unused / not referenced large Objects

2012-11-28 Thread Thomas Kellerer
Tobias Meyer, 28.11.2012 10:02: Hello list, we have a database with several tables containing blobs (as oid), that reference large objects in pg_largeobject. It is my understanding, that the large objects will not be deleted if a row containing the oid is deleted – you have to do that yourself

[GENERAL] Updateable VIEWS and the manual

2012-11-28 Thread Thomas Kellerer
Hi, I just noticed the following statement in the CREATE VIEW documentation (9.2 and 9.1): Currently, views are read only: the system will not allow an insert, update, or delete on a view. You can get the effect of an updatable view by creating rules that rewrite inserts, etc. on

Re: [GENERAL] Postgres Index

2012-11-15 Thread Thomas Kellerer
Vishalakshi Navaneethakrishnan, 15.11.2012 12:11: Hi all, Can we create composite index for one text column and integer column? Yes of course. What happened when you tried? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

<    1   2   3   4   5   6   7   8   9   >