[GENERAL] How to cast to regprocedure with OUT parameters

2014-08-14 Thread Thomas Kellerer
Hello, pg_get_functiondef() can be used quite easily by using a cast to regprocedure, like this: select pg_get_functiondef('public.foo(text, text, text)'::regprocedure); However if the function is defined with an out parameter like this: create or replace function foo(p1 text, p2 out te

Re: [GENERAL] How to cast to regprocedure with OUT parameters

2014-08-14 Thread Thomas Kellerer
Tom Lane wrote on 14.08.2014 17:33: Leave out the OUT parameters altogether: select pg_get_functiondef('public.foo(text, text)'::regprocedure); Only IN parameters contribute to the function's identity; OUT parameters are just a variant method of specifying its return type. Ah, great. I didn't

Re: [GENERAL] POWA tool

2014-08-20 Thread Thomas Kellerer
Ramesh T schrieb am 20.08.2014 um 17:41: > Hello, > > when i ran following query, > postgres=# SELECT * FROM pg_stat_statements; > > > ERROR: relation "pg_stat_statements" does not exist > LINE 1: SELECT * FROM pg_stat_statemen

Re: [GENERAL] psql and tab-delimited output

2014-09-06 Thread Thomas Kellerer
Abelard Hoffman wrote on 06.09.2014 09:32: Traditionally, to generate a TSV report, I've simply invoked psql with: --no-align --field-separator '\t' --pset footer=off That works in most cases, except when your column values contain tabs themselves. I know that COPY() will escape tabs (as \t), a

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-15 Thread Thomas Kellerer
cowwoc wrote on 15.09.2014 19:55: H2, HSQLDB, Derby all support Java triggers. But only because they already live/run inside a JVM, so it's the "natural" choice of language. And H2 and Derby *only* support Java stored procedures. The main disadvantage I see with that is, that you can't "just

Re: [GENERAL] wide row insert via Postgres jdbc driver

2014-09-23 Thread Thomas Kellerer
Sameer Kumar schrieb am 23.09.2014 um 07:24: > I am working with a vendor and planning to deploy their application > on PostgreSQL as backend. They have cautioned the customer that > PostgreSQL's jdbc driver v9.1 (build 900) has issues which causes > deadlocks while "wide record inserts". Can you

[GENERAL] Synchronous replication + pgPool: not all transactions immediately visible on standby

2014-09-24 Thread Thomas Kellerer
Hello, we have a setup with Postgres 9.3.4 running on Ubuntu (don't know the exact version) using streaming replication with a hot standby and pgPool 3.3.3 as a loadbalancer in front of the two Postgres servers. While running automated tests we noticed that despite the fact that replication is

[GENERAL] Re: Synchronous replication + pgPool: not all transactions immediately visible on standby

2014-09-25 Thread Thomas Kellerer
> I think your problem is not relevant to pgpool-II. > > PostgreSQL's "synchronous" replication is actually not synchronous > (it's confusing but the naming was developer's decision). Primary > server sends the committed transaction's WAL record to standby and > wait for it is written to the stand

Re: [GENERAL] Postgres as key/value store

2014-09-28 Thread Thomas Kellerer
snacktime wrote on 28.09.2014 01:48: I'm looking for some feedback on the design I'm using for a basic key/value storage using postgres. Are you aware of Postgres' "native" key/value store: hstore? http://www.postgresql.org/docs/current/static/hstore.html Or Postgres JSON support? Especially

[GENERAL] pg_get_expr() hangs with uncommitted DDL transaction

2014-11-11 Thread Thomas Kellerer
Hello, I noticed the following behaviour in the JDBC driver: In one transaction run an ALTER TABLE ADD COLUMN ... statement with auto-commit off, but don't commit the statement In another transcation, call DatabaseMetaData.getColumns() for this table - this call will wait until the first trans

Re: [GENERAL] pg_get_expr() hangs with uncommitted DDL transaction

2014-11-11 Thread Thomas Kellerer
Tom Lane schrieb am 11.11.2014 um 16:35: >> Is there a reason why pg_catalog.pg_get_expr() will wait until the exclusive >> lock on the table is released? > > Yes. It needs to extract attribute names, data types, etc for the target > table and it would also like to be sure that that data is sel

Re: [GENERAL] pg_get_expr() hangs with uncommitted DDL transaction

2014-11-11 Thread Thomas Kellerer
Tom Lane schrieb am 11.11.2014 um 17:08: >> Does this mean that pg_get_expr() selects additional data from the table, >> instead of just using the values that are provided by the caller? > > No, it means it depends on backend code that is also used when accessing > the table "for real", and that

[GENERAL] Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"

2014-11-17 Thread Thomas Kellerer
Klaus Hofeditz ]project-open[ wrote on 17.11.2014 23:10: > Hi guys, > I need to drop a view in order to alter a type of a column: numeric(12,1) -> numeric(12,2): > > ERROR: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view "TransTasksCube" depends on column "

Re: [GENERAL] Detecting master/slave

2014-11-21 Thread Thomas Kellerer
Steve Pribyl schrieb am 21.11.2014 um 15:13: > Is there a better/recommended way to determine which host in a > cluster is the master or slave besides rescue.conf or > pg_stat_replication? > > Just looking for the "right" way to know which > host is which. What about select pg_is_in_recovery

[GENERAL] (never executed) in the execution plan

2014-12-05 Thread Thomas Kellerer
I just encountered something like this in an execution plan: -> Hash (cost=19865.48..19865.48 rows=489 width=12) (never executed) Output: ly.total_count, ly.customer_id -> Subquery Scan on ly (cost=19864.50..19865.48 rows=489 width=12) (never executed) Output: ly.total

Re: [GENERAL] Storing Video's or vedio file in DB.

2014-12-17 Thread Thomas Kellerer
Albe Laurenz schrieb am 17.12.2014 um 11:07: > and the performance will be worse than reading files from the file system. There is a Microsoft research [1] (from 2006) which tested this "myth" using SQL Server. It showed that the database might actually be faster than the file system. As this

Re: [GENERAL] Advice for using integer arrays?

2015-01-07 Thread Thomas Kellerer
> BTW, looking at your example, you might be more interested in ranges, > see for example: > http://www.postgresql.org/docs/9.2/static/rangetypes.html > > Conceptually they are a bit different and there isn't support for > multi-ranges AFAIK You could have an array of ranges -- Sent via pgs

Re: [GENERAL] Simple Atomic Relationship Insert

2015-01-13 Thread Thomas Kellerer
Brian Dunavant wrote on 13.01.2015 22:33: What issue are you having? I'd imagine you have a race condition on the insert into hometowns, but you'd have that same race condition in your app code using a more traditional 3 query version as well. I often use CTEs like this to make things atomic.

Re: [GENERAL] can you have any idea about toast missing chunk issu resolution

2015-01-15 Thread Thomas Kellerer
M Tarkeshwar Rao wrote on 15.01.2015 13:30: Hi all, We are getting following error message on doing any action on the table like(Select or open from pgadmin). Please suggest. ERROR: missing chunk number 0 for toast value 54787 in pg_toast_2619 ** Error ** ERROR: missing chu

Re: [GENERAL] Can pg_restore produce create or replace commands

2015-01-17 Thread Thomas Kellerer
Berend Tober wrote on 17.01.2015 19:05: I often work with the output of pg_restore from a custom format dump file. For example a file produced by running pg_restore -s -1 -L listfile dumpfile where listfile has been edited to comment out most of the rows to leave only the data base objects I'm

Re: [GENERAL] Any changes in Java and PGSQL 9.4?

2015-01-18 Thread Thomas Kellerer
Bjørn T Johansen wrote on 18.01.2015 20:20: Just noticed that a column field of type bigint containing a null, becomes a 0 when retrieving it from the resultset using JDBC. If I run the same application against my old 9.3 database, the value retrieved is a null You need to show us some

Re: [GENERAL] (unknown)

2015-01-27 Thread Thomas Kellerer
Oliver Dizon schrieb am 27.01.2015 um 11:46: > I hope I'm in the right place to throw this. I just want to ask the reason > behind this weird scenario. > > All records were deleted in a table even if the subquery in the where clause > has a missing a column. > > --from a certain script where ta

Re: [GENERAL] Postgresql - COPY TO - get number row inserted - from JDBC

2015-02-07 Thread Thomas Kellerer
Nicolas Paris wrote on 07.02.2015 15:14: Hello ! My goal is to get the result from "COPY TO ..." query, from JDBC. This query returns : COPY X (where X is number line inserted) 1) Can I can I consider it useless, since when no error, all lines are suposed to be inserted ? 2) If not useless, h

Re: [GENERAL] EXCLUDE constraint with not equals

2015-02-09 Thread Thomas Kellerer
Kai Groner schrieb am 10.02.2015 um 01:38: > Given the following table, I would like to ensure that all the rows for an > email that have a user defined map to the same user. > > CREATE TABLE person ( > id INTEGER PRIMARY KEY, > user TEXT, > email TEXT NOT NULL); > > > What I think I'm l

Re: [GENERAL] How to convert "output deleted/inserted into" in MySQL to Postgres

2015-02-20 Thread Thomas Kellerer
Tong Michael wrote on 20.02.2015 21:59: hey guys, I'm kinda new to Postgres and I'm learning it now. I have work to convert some stored procedures in MySQL to Postgres and I came across an issue here that I can't solve: update db.user set Deleted= 1 , Update

Re: [GENERAL] Postgres architecture for multiple instances

2015-02-22 Thread Thomas Kellerer
Samuel Smith schrieb am 23.02.2015 um 05:21: > I am stuck with redhat as the OS so I'll only have initdb. But this is a good > point. > I assume there is nothing wrong with having multiple postgres instances > (clusters) all running under a > single postgres user on different ports on the same

Re: [GENERAL] (unknown)

2015-02-24 Thread Thomas Kellerer
Ramesh T schrieb am 24.02.2015 um 19:08: > CREATE AGGREGATE group_concat(text) ( > SFUNC = _group_concat, > STYPE = text > ); > is it availabe in oracle..? https://docs.oracle.com/cd/E11882_01/server.112/e41084/functions089.htm#SQLRF30030 -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] how to do merge in postgres ("with upsert as" not supported)

2015-02-27 Thread Thomas Kellerer
Tong Michael schrieb am 26.02.2015 um 21:23: > > hey, guys, I came across a merge statement when I'm trying to convert stored > procedures from Mysql to Postgres: > > __ __ > > merge into db.ChargePeriod d > using ( > select ba.ClientID > ... > ... That can't be MySQL - MyS

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 you

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 (pg

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] 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, ',') fro

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 (pgsql-general@p

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: http://www.postgresql.or

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: http://www.

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 o

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 an

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 tab

[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 ver

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

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 v

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 FK

[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 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 all rows to verify that t

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 upgrade

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] 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] 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 fi

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 - wh

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 (pg_get

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

2013-03-15 Thread Thomas Kellerer
Kevin Grittner, 15.03.2013 14:36: 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 requirement of ol

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 u

[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); alt

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 r

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 comp

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

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. Th

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 post

[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: cre

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

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 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 an i

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] upsert functionality

2013-05-15 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 woul

[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 pgsql-gene

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] 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 set

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 up

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 then

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

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 chang

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 = "joh

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 parame

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 wi

Re: [GENERAL] new instance of postgres on windows

2013-07-18 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 a

[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 an

[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. I

[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?) Postgre

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

2013-08-04 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 t

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 scrip

Re: [GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Thomas Kellerer
Peter J. Holzer schrieb am 10.02.2017 um 14:02: > So it's doing a sequential scan on the initial select in the recursive > CTE, but using the index on the subsequent selects. > > But why? If it uses the index on > SELECT MIN(periodizitaet) FROM facttable_imf_ifs WHERE periodizitaet > 'x' > sho

[GENERAL] Re: Causeless CPU load waves in backend, on windows, 9.5.5 (EDB binary).

2017-02-13 Thread Thomas Kellerer
Nikolai Zhubr schrieb am 13.02.2017 um 23:03: Maybe I should have been more specific. What I need is debugging/profiling pure communication side of server operation, implying huge lots of requests and replies going over the wire to and from the server within some continued (valid) session, but so

[GENERAL] Documentation inconsistency (at least to me)

2017-02-13 Thread Thomas Kellerer
I wonder why regexp_split_to_array() is listed under "String functions and operators" [1] but string_to_array() is listed under "Array functions and operators" [2] I find that a bit inconsistent - I would expect to find both in the same chapter. I would suggest to put both into "String functio

Re: [GENERAL] Problems with Greatest

2017-02-15 Thread Thomas Kellerer
Teddy Schmitz schrieb am 16.02.2017 um 05:38: > As a quick follow up I just did an explain on the query, > > > Aggregate (cost=258007258.87..258007258.88 rows=1 width=8) > -> Nested Loop (cost=0.00..184292254.83 rows=14743000807 width=16) > -> Seq Scan on t1 (cost=0.00..3796.41 rows=263141 w

Re: [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver array as string

2017-03-02 Thread Thomas Kellerer
Alexander Farber schrieb am 02.03.2017 um 21:45: I am calling this stored function - CREATE OR REPLACE FUNCTION words_get_board( in_gid integer ) RETURNS TABLE ( out_bid integer, out_letters varchar[15][15], out_values integ

Re: [GENERAL] CenOS 5/Postgresql 9.6

2017-03-17 Thread Thomas Kellerer
Steve Crawford schrieb am 17.03.2017 um 20:15: I'm aware of all those dates. Also that 9.6 has been out for six-months, and that RHEL/CentOS 5 are listed among the currently supported versions at https://yum.postgresql.org/. The question remains - does anyone know where I might find packages so

Re: [GENERAL] Incremental / Level -1 backup in PG

2017-03-22 Thread Thomas Kellerer
Rakesh Kumar schrieb am 22.03.2017 um 01:27: > PG does not have a concept of incremental backup. Postgres doesn't, but external tools can. e.g. Barman can do incremental backups: https://blog.2ndquadrant.com/incremental-backup-barman-1-4-0/ -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] Combining INSERT with DELETE RETURNING

2017-03-24 Thread Thomas Kellerer
Alexander Farber schrieb am 24.03.2017 um 16:06: > the doc https://www.postgresql.org/docs/9.6/static/sql-delete.html states: > > "The syntax of the RETURNING list is identical to that of the output list of > SELECT." > > So I am trying to rewrite the INSERT .. ON CONFLICT DO NOTHING followed b

Re: [GENERAL] Trigger based logging alternative to table_log

2017-03-27 Thread Thomas Kellerer
Jeff Janes schrieb am 27.03.2017 um 19:07: I have some code which uses table_log (http://pgfoundry.org/projects/tablelog/) to keep a log of changes to selected tables. I don't use the restore part, just the logging part. It creates a new table for each table being logged, with several additiona

[GENERAL] Do I need to COMMIT an analyze statement?

2017-03-31 Thread Thomas Kellerer
Hello, something I have always wondered: If I run with autocommit turned OFF, do I need to commit an ANALYZE statement, or is that "non-transactional"? Thomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.o

Re: [GENERAL] Do I need to COMMIT an analyze statement?

2017-03-31 Thread Thomas Kellerer
David G. Johnston schrieb am 31.03.2017 um 16:49: On Friday, March 31, 2017, Thomas Kellerer mailto:spam_ea...@gmx.net>> wrote: Hello, something I have always wondered: If I run with autocommit turned OFF, do I need to commit an ANALYZE statement, or is that "non-tr

[GENERAL] Suggestion to improve select pg_reload_conf()

2017-04-03 Thread Thomas Kellerer
I would like to suggest an improvement to the select pg_reload_conf() function. Currently this will only return true or false indicating if reloading was successful. I think it would be a "nice-to-have" if the function would also return the GUCs that have been changed, similar to what is being

Re: [GENERAL] browser interface to forums please?

2017-04-04 Thread Thomas Kellerer
vinny schrieb am 04.04.2017 um 12:01: > I'd love to have an RSS feed that contains only new questions, so I can just > watch the popup > on my screen the way I do with the rest of the world, and not have to deal > with replies to topics that I don't care about anyway. You can read them as a news

Re: [GENERAL] Migration Query

2017-05-08 Thread Thomas Kellerer
PAWAN SHARMA schrieb am 08.05.2017 um 17:13: > Does one any having list of bottlenecks and workarounds while migrating data > from Oracle to Postgresql. like what are thing which we can migrate from > Oracle database to Postgresql and what we can't? One thing I have seen regularly is the wrong tr

Re: [GENERAL] Top posting....

2017-05-11 Thread Thomas Kellerer
Tom Lane schrieb am 11.05.2017 um 19:43: > Bottom posting without trimming is just an awful combination: > whatever you do, don't do that. Amen to that. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailp

Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Thomas Kellerer
Ronny Abraham schrieb am 15.05.2017 um 19:25: 4. Insert 10,000 rows to JSON, execution time (sec): 122.855001211 5. Insert 10,000 rows to JSONB, execution time (sec): 122.128999233 What’s interesting is that inserting to JSONB is slightly faster than inserting to JSON. A difference in 0.7

Re: [GENERAL] storing large files in database - performance

2017-05-16 Thread Thomas Kellerer
Eric Hill schrieb am 16.05.2017 um 14:25: > I have a node.js application using PostgreSQL to store uploaded > files. The column in which I am storing the file contents is of type > “bytea” with “Storage” type set to “EXTENDED”. Storing a 12.5 MB file > is taking 10 seconds, and storing a 25MB file

Re: [GENERAL] storing large files in database - performance

2017-05-16 Thread Thomas Kellerer
John R Pierce schrieb am 16.05.2017 um 16:44: > On 5/16/2017 7:35 AM, Thomas Kellerer wrote: >> When my (JDBC based) SQL client and the database server are on the same >> computer... > > node.js is Javascript, not java w/ jdbc I know that. I mentioned JDBC so that it

Re: [GENERAL] logical replication in PG10 BETA

2017-05-23 Thread Thomas Kellerer
Igor Neyman schrieb am 22.05.2017 um 21:33: > Does built-in logical replication work on Windows in PG10 BETA release? > > I can’t make it working so far. > > I created Publication on “source” PG server, but when I’m trying to CREATE > SUBSCRIPTION… on “destination” server, I’m getting: > > “ERR

<    1   2   3   4   5   6   7   8   9   >