Re: [GENERAL] Conflicting function name in dynamically-loaded shared library

2015-01-28 Thread Albe Laurenz
Adam Mackler wrote: > I am wanting to define some functions as described in section 35.9 of > the manual, "C-Language Functions." I am compiling pre-existing files > of c-code from another project into object files, and then linking > those object files into a shared library along with my own func

Re: [GENERAL]

2015-01-27 Thread Albe Laurenz
Oliver Dizon wrote: > 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 table_id is not yet existin

Re: [GENERAL] Pattern matching ints

2015-01-26 Thread Albe Laurenz
Tim Smith wrote: > Is there a more efficient way to pattern match integer columns other > than something like : > > where cast(mynumber as text) ~ '.*123.*' > > > I also seem to recall you can't create indexes on casts either ? I don't think you can do this without converting the column to a st

Re: [GENERAL] Concurrent Inserts

2015-01-21 Thread Albe Laurenz
sri harsha wrote: >>>Is there any way to stop concurrent inserts to happen on a single table >>> ?? >> If you really want that, it is easy with table locks. > Actually i am using a FDW , in which the data is written into a single > file. So when i do > concurrent inserts , the data is w

Re: [GENERAL] Concurrent Inserts

2015-01-21 Thread Albe Laurenz
sri harsha wrote: >Is there any way to stop concurrent inserts to happen on a single table ?? > > Query 1 : INSERT INTO TABLE_A SELECT * FROM TABLE1; > Query 2 : INSERT INTO TABLE_A SELECT * FROM TABLE2; > Query 3 : SELECT * FROM TABLE_A; > > Assume i have the above queries. Query 1 and Query

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

2014-12-17 Thread Albe Laurenz
Thomas Kellerer wrote: > 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

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

2014-12-17 Thread Albe Laurenz
VENKTESH GUTTEDAR wrote: > I am using PostGreSQL 9.3.5 and DJango1.7.5 and python 3.3. > > I am working on a application where i will get video files from mobile app, > and i have to store in the server, > so my question is how do i store video's or video files in DB, or do i need > to store onl

Re: [GENERAL] Use cases for lateral that do not involve a set returning function

2014-12-09 Thread Albe Laurenz
AJ Welch wrote: > http://blog.heapanalytics.com/postgresqls-powerful-new-join-type-lateral/ > > I suspected some of the claims in the post may not have been accurate. This > one in particular: > > "Without lateral joins, we would need to resort to PL/pgSQL to do this > analysis. Or, if our data

Re: [GENERAL] (never executed) in the execution plan

2014-12-05 Thread Albe Laurenz
Thomas Kellerer wrote: > 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 exe

Re: [GENERAL] TRUNCATE and CREATE TABLE LIKE for foreign tables

2014-12-03 Thread Albe Laurenz
sri harsha wrote: > Is it possible to implement TRUNCATE and CREATE TABLE LIKE for a foreign > table. Is there anyway i > can write a function to implement those queries in my FDW ?? This is currently not possible, it would need an extension to the FDW API. If you can come up with a good design,

Re: [GENERAL] Is "WITH () UPDATE" Thread Safe ?

2014-12-03 Thread Albe Laurenz
David G Johnston wrote: > Albe Laurenz *EXTERN* wrote >> Paul GOERGLER wrote: >>> I have a lot of tickets, i need to take a batch of tickets and process >>> them. >>> So the process is : >>> SELECT ONLY 100 tickets >>> PROCESS ticket >>&g

Re: [GENERAL] Serialization exception : Who else was involved?

2014-12-02 Thread Albe Laurenz
Olivier MATROT wrote: > Serialization conflict detection is done in > src/backend/storage/lmgr/predicate.c, where transactions > that are doomed to fail are marked as such with the SXACT_FLAG_DOOMED flag. > > I simply added elog(NOTIFY,...) calls with the DEBUG1 level, each time the > flag is se

Re: [GENERAL] Is "WITH () UPDATE" Thread Safe ?

2014-12-01 Thread Albe Laurenz
Paul GOERGLER wrote: > I have a lot of tickets, i need to take a batch of tickets and process them. > So the process is : > SELECT ONLY 100 tickets > PROCESS ticket > MARK THEM AS « done » > > I’m selecting the tickets with : > > WITH t0 AS ( > SELECT t.id, > RANDOM() AS rank, > EXTRACT(EPOCH

Re: [GENERAL] Performance question

2014-11-21 Thread Albe Laurenz
Anil Menon wrote: > I would like to ask from your experience which would be the best "generic" > method for checking if row > sets of a certain condition exists in a PLPGSQL function. > > I know of 4 methods so far (please feel free to add if I missed out any > others) [...] Are you aware that

Re: [GENERAL] pgdump (9.2.4) not dumping all tables

2014-11-21 Thread Albe Laurenz
Marcos Cano wrote: [missing data after dump/restore of DB with PostGIS] > i found this in the file... > > ERROR: could not access file "$libdir/rtpostgis-2.0": No such file or > directory Could it be that PostGIS was not installed as an extension in the old database, so that the dump contains th

Re: [GENERAL] String searching

2014-11-18 Thread Albe Laurenz
Jonathan Vanasco wrote: > On Nov 17, 2014, at 12:55 PM, Robert DiFalco wrote: >> SELECT * FROM MyTable WHERE upper(FullName) LIKE upper('%John%'); >> >> That said, which would be the best extension module to use? A "gist" index >> on the uppercased column? >> Or something else? Thanks! > > Pe

Re: [GENERAL] NEW in after insert trugger contained incorrect data

2014-11-14 Thread Albe Laurenz
Brilliantov Kirill Vladimirovich wrote: >> You should post the table definition and the whole trigger; the error >> message seems to refer to things you omitted in your quote. > > Table with statistic: > CREATE TABLE trassa.cpu_load_stat > ( >id serial NOT NULL, >device integer NOT NULL, >

Re: [GENERAL] NEW in after insert trugger contained incorrect data

2014-11-14 Thread Albe Laurenz
Brilliantov Kirill Vladimirovich wrote: > I use Postgre-9.3.5 on windows7 x64. > I use simple trigger for store some statistic data, it code: > SELECT field IN variable FROM table WHERE ...; > IF FOUND THEN >UPDATE table SET field = ...; > ELSE >INSERT INTO table (field) VALUES(value); > EN

Re: [GENERAL] Two instances of Postgres with single data directory

2014-11-14 Thread Albe Laurenz
dineshkaarthick wrote: > I would like to know how is the "Shared Disk Failover" replication achieved > if it is not possible to share the data directory ? I am referring to the > 1st solution in the mentioned link, > http://www.postgresql.org/docs/9.3/static/different-replication-solutions.html Yo

Re: [GENERAL] trigger Before or After

2014-11-11 Thread Albe Laurenz
avpro avpro wrote: > in the pgsql documentation > (http://www.postgresql.org/docs/9.1/static/sql-createtrigger.html) > > > i haven't seen anything referring to: how is affected the data inserted in > the new table by a trigger > Before Insert compared with a trigger After Insert? and anything re

Re: [GENERAL] undefined struct 'pg_conn' on Windows7

2014-10-29 Thread Albe Laurenz
Brilliantov Kirill Vladimirovich wrote: > I install postgre from postgresql-9.3.5-3-windows-x64.exe file and try > use libpq.lib from it. > My system Windows7 ServicePack1 and I use VisualStudioExpress 12 for > write code. > I add path to \include and > \lib in project and include libpq-fe.h file.

Re: [GENERAL] FDW wrapper for clustered app management

2014-10-17 Thread Albe Laurenz
Jerome Wagner wrote: [wants to access an application server farm with FDW] > Clearly, I am trying to see how I could twist the fdw wrappers into a sort of > manhole inside the > application, without resorting to a classic event based mechanism. That's too metaphorical for me to understand. > I c

Re: [GENERAL] FDW wrapper for clustered app management

2014-10-17 Thread Albe Laurenz
Jerome Wagner wrote: > I am considering (postgres 9.3+) the idea of opening a R/W access into a > clustered application by > creating one fdw server from a central database to each server a cluster. > > That would imply opening a port on each server inside the application, > listening for incomi

Re: [GENERAL] copying a large database to change encoding

2014-10-15 Thread Albe Laurenz
Matthew Chambers wrote: > Would something like this work best, or is it better to use pgdump? > > CREATE DATABASE newDatabase TEMPLATE oldDatabase ENCODING 'UTF8' > > Does using a template do a file system copy or just SQL copy everything over? Using the old database as template will not change

Re: [GENERAL] Getting my Database name in a C Extension

2014-10-03 Thread Albe Laurenz
Cedric Berger wrote: >>> 1) What is the easiest way to get that directly in C? >> >> The usual locution is "get_database_name(MyDatabaseId)". > > Ok, but then how do I find "MyDatabaseId" in, say, > a BeginForeignScan() or GetForeignRelSize() FDW callback? It is a global, all you should have to d

Re: [GENERAL] Postgre SQL SHA-256 Compliance

2014-09-22 Thread Albe Laurenz
Anthony Burden wrote: > validate some software with you to > ensure that all our installed PostgreSQL software meets SHA-256 compliance. > There is basically two things we are looking for: > > 1) Identify all COTS software purchased as part of scheduled and budgeted > technology refreshes and upgr

Re: [GENERAL] Detecting query timeouts properly

2014-09-22 Thread Albe Laurenz
Evan Martin wrote: > I'm using PostgreSQL 9.2.8 via Npgsql 2.2.0. When a query times out it > returns error 57014 with the message "canceling statement due to > statement timeout". I use the message to detect the timeout and re-try > in some cases. It seems a bit wrong to rely on the message, thoug

Re: [GENERAL] cloning database

2014-09-19 Thread Albe Laurenz
Philipp Kraus wrote: > I need around 150 copies of a database (for an exam). I have got a > database with tables and data and for my exam I would copy this > database in his way: > > database_source > > database1 > database2 > …. > database150 > > Is there a buildin way to clone the "database_so

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-10 Thread Albe Laurenz
Vinayak wrote: > We are converting the Oracle's CREATE SYNONYM statement into PostgreSQL. > I think to replace the SYNONYM we use search_path in PostgreSQL and the same > thing is explained in the below post also. > http://postgresql.1045698.n5.nabble.com/Synonyms-in-PostgreSQL-9-2-4-td5757986.html

Re: [GENERAL] Expected behaviour of \d in regexp with exponent numbers ?

2014-09-01 Thread Albe Laurenz
Arnaud Lesauvage wrote: > I just came accross this trying to upgrade my server from 8.4.8 to 9.3.4 : > > SELECT substring('²' FROM E'\\d'); > > 8.4 : NULL > 9.3 : "²" > > Am I correct to expect NULL in this case ? I get a different result on Linux: test=> SHOW server_encoding; server_encoding

Re: [GENERAL] Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions

2014-08-29 Thread Albe Laurenz
Vinayak wrote: > We have converted Oracle SYSDATE to PostgreSQL statement_timestamp() but > there is a difference in timezone. > SYSDATE returns the time on the server where the database instance is > running(returns operating system time) so the time depends on the OS > timezone setting. > while t

Re: [GENERAL] Using fmgr_hook

2014-08-26 Thread Albe Laurenz
Sameer Thakur wrote: >> My experience is that you cannot set breakpoints before the library >> is loaded, so you first have to call a function in the library, then >> you interrupt and set the breakpoint. > I tried to do the following > 1. Execute Postgres (now auto_explain is loaded) > 2. Start a

Re: [GENERAL] Using fmgr_hook

2014-08-25 Thread Albe Laurenz
Sameer Thakur wrote: > In the process of implementing my own version of sysdate, i was trying > to use the fmgr_hook. [...] > To debug i have a breakpoint inside custom_fmgr_hook. > > Debugging: > 1. Start postgres > 2. Start psql connecting to postgres > 3. Attach gdb to process spawned off by

Re: [GENERAL] Inserting large binary data into lo type table

2014-08-13 Thread Albe Laurenz
Jose Moreira wrote: > I guess this is easy a question for the gurus, but afraid I cannot get te > answer! > > I have this table: > > aif_test=# \d sbox; > Table "public.sbox" > Column | Type | Modifiers > ++--- > id |

Re: [GENERAL] Postgres 9.3 tuning advice

2014-08-12 Thread Albe Laurenz
dushy wrote: > Iam running a postgresql 9.0.13 master/slave instance in a write heavy > workload. > > The hardware is a Dell 720, E5530 - 8 core, 128GB RAM. The database (around > 250g with indexes/bloat etc) is sitting on flashcache device with 2 fusion- > io PCIe MLC SSDs as frontend and a MD320

Re: [GENERAL] ENCODING = 'LATIN1' LC_CTYPE?

2014-08-08 Thread Albe Laurenz
Sylvia Preuß wrote: > I’d like to create a database with ENCODING LATIN1 . > > CREATE DATABASE z_latin1 > WITH OWNER = admin >ENCODING = 'LATIN1' >TABLESPACE = pg_default >LC_COLLATE = 'German_Germany.1252' >LC_CTYPE = 'German_Germany.1252' >CONNECTION LIM

Re: [GENERAL] String concatenation operator which keeps trailing spaces in CHAR(n) columns

2014-07-30 Thread Albe Laurenz
Andrus wrote: >> Use "bpchar" instead of "text" in the definition of function and operator. >> Otherwise col1 gets cast to "text" and loses its trailing spaces. > > Thank you very much. > It worked. > Which notation to use for this ? > > Is it reasonable use "+" as such operator for strings or sh

Re: [GENERAL] String concatenation operator which keeps trailing spaces in CHAR(n) columns

2014-07-30 Thread Albe Laurenz
Andrus wrote: > How to create string concatenation operator which preserves trailing spaces > on CHAR(n) type columns ? > > I tried code below, but it returns AB (without spaces). > How to force it to return A B (keep space after A) ? > > Andrus. > > CREATE OR REPLACE FUNCTION public.stringconca

Re: [GENERAL] postgresql_fdw issues with triggers on the foreign tables

2014-07-23 Thread Albe Laurenz
Eelke Klein wrote: > I'm experimenting with using foreign data wrappers to get data from one > database to another. Most > things work perfectly but I am encountering two issues with triggers on the > foreign tables. > > The first one is when a query triggers a trigger on the foreign table the

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread Albe Laurenz
David G Johnston wrote: >> Also, I think that your method is vulnerable to race conditions: >> If somebody else increments the sequence between the INSERT and >> "SELECT lastval()" you'd get a wrong value. > > Uh, no. It returns that last value issued in the same session - which is > race-proof.

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread Albe Laurenz
rob stone wrote: >> I have a question on the right/correct practice on using the serial >> col's sequence for insert. >> >> Best way of explanation is by an example: >> >> create table id01 (col1 serial, col2 varchar(10)); >> >> insert into id01(col2) values ( 'data'|| >> currval('id01_col1_seq')::

Re: [GENERAL] conditional IF statements in postgresql

2014-07-07 Thread Albe Laurenz
Madhurima Das wrote: > I am writing a C program to access a PostgreSQL database, where > I add a column if it doesn't exists in the table > or, update the column, if the column already exits. > Please suggest how to work with the conditional statements. > N.B. I wrote the following: > > res = PQe

Re: [GENERAL] Migration error " invalid byte sequence for encoding "UTF8": 0xff " from mysql 5.5 to postgresql 9.1

2014-07-04 Thread Albe Laurenz
John R Pierce wrote: > On 7/4/2014 2:12 AM, sunpeng wrote: >> Thank you, friend, I use --hex-blob : >> mysqldump -v -nt --complete-insert=TRUE --compatible=postgresql >> --default-character-set=utf8 --skip-add-locks --compact >> --no-create-info --skip-quote-names --hex-blob -uroot -p test >> vide

Re: [GENERAL] Migration error " invalid byte sequence for encoding "UTF8": 0xff " from mysql 5.5 to postgresql 9.1

2014-07-04 Thread Albe Laurenz
sunpeng wrote: >>> load data to postgresql in cmd(encoding is GBK) is WIN8: >>> >>> psql -h localhost -d test -U postgres < dbdata.sql >>> >>> I got the error: >>> ERROR: invalid byte sequence for encoding "UTF8": 0xff >> If the encoding is GBK then you will get errors (or incorrect >> charact

Re: [GENERAL] pgsql age function showing 00:00:00 with year argument

2014-06-23 Thread Albe Laurenz
Arup Rakshit wrote: > yelloday-staging::YELLOW=> select id, dob from users; > id | dob > +- > 13 | > 9 | 1967-02-13 14:00:00 > 10 | > 11 | > 8 | 1977-06-05 14:00:00 > 15 | > 21 | > 14 | 2014-05-25 14:00:00 > 37 | > 22 | > 26 | 2014-05-06 14:00:00 > 32

Re: [GENERAL] Delete trigger and data integrity

2014-05-27 Thread Albe Laurenz
Yvonne Zannoun wrote: > I have this question regarding delete triggers and how it affects data > integrity. > So here goes: I have this trigger which deletes everything before I insert > new rows. > > CREATE OR REPLACE FUNCTION delete_records() > RETURNS TRIGGER AS $$ > BEGIN > delete from "

Re: [GENERAL] libpq: indefinite block on poll during network problems

2014-05-27 Thread Albe Laurenz
Dmitry Samonenko wrote: > I have an application which uses libpq for interaction with remote PostgreSQL > 9.2.4 server. Clients > and Server nodes are running Linux and connection is established using TCPv4. > The client application > has some small fault-tolerance features, which are activated w

Re: [GENERAL] Query with error - DOW FROM timestamp

2014-05-23 Thread Albe Laurenz
Victor Sterpu wrote: > When I run the query from down I receive an error. > How can I write this query to receive the day ot the week. > SELECT EXTRACT(DOW FROM timestamp TO_TIMESTAMP('14-10-2011', 'DD-MM-')); Maybe you mean SELECT EXTRACT(DOW FROM TO_TIMESTAMP('14-10-2011', 'DD-MM-'));

Re: [GENERAL] Oracle to PostgreSQL replication

2014-05-09 Thread Albe Laurenz
Sameer Kumar wrote: > I guess I will be exploring more on oracle foreign data wrapper. > > Has anyone tried using oracle_fdw with Oracle RAC? I am wondering how would > it handle failovers. I have not tried it, but it should work as follows: - You'll have to use a connect string that is correct

Re: [GENERAL] Oracle to PostgreSQL replication

2014-05-07 Thread Albe Laurenz
Sameer Kumar wrote: > I need to setup a replication process for continuously replicating changes > happening in an Oracle > Database to a PostgreSQL database. > > > My Oracle Database is version 11.2 and setup as a cluster with RAC > My Postgres database version is 9.2 > > Oracle Database is ru

Re: [GENERAL] ERROR: permission denied for database control

2014-05-07 Thread Albe Laurenz
Suya Huang wrote: > I’ve encountered a weird problem in PostgreSQL : > > postgres=> create user test password ‘test’; > > postgres=> grant select on pg_catalog.pg_database_size to test; This statement produces an error: ERROR: relation "pg_catalog.pg_database_size" does not exist > postgres=> g

Re: [GENERAL] Security Issues: Allowing Clients to Execute SQL in the Backend.

2014-04-30 Thread Albe Laurenz
Hello World wrote: > Denial of service is indeed a problem. Is there a way to limit the execution > time of a request? Yes, setting statement_timeout. But if a client can exectue arbitrary statements, that could also be statements like: SET statement_timeout=0; SET work_mem=1024GB; > I'm using

Re: [GENERAL] Security Issues: Allowing Clients to Execute SQL in the Backend.

2014-04-30 Thread Albe Laurenz
Hello World wrote: > Given this are there any security other issues about letting client > applications execute arbitrary SQL > commands on the backend database? There shouldn't be any security problems, just be careful that you don't give the user more permissions than you want to. But a user

Re: [GENERAL] pg_ctl start error and lock file

2014-04-29 Thread Albe Laurenz
Dev Kumkar wrote: > Faced following issue when trying to start database using pg_ctl: > > FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission > denied > > Accidentally someone cleaned up /tmp and recreated it but without any write > permissions to non-root > user, if the no

Re: [GENERAL] WAL Replication + PITR

2014-04-29 Thread Albe Laurenz
basti wrote: > is it possible to have WAL Replication and Point-in-Time Recovery like > follows: > > DB-Master -- (WAL to Slave) --> DB-Slave > | > |---> (PITR to an other Server) > > Thanks for any help! Sure. You can use something like the UNIX command "tee" in "archive_command" t

Re: [GENERAL] Is this a planner bug?

2014-04-22 Thread Albe Laurenz
> Torsten Förtsch wrote: >>> I got this plan: >>> >>> Limit (cost=0.00..1.12 rows=1 width=0) >>>-> Seq Scan on fmb (cost=0.00..6964734.35 rows=6237993 width=0) >>> Filter: ... >>> >>> The table has ~80,000,000 rows. So, the filter, according to the plan, >>> filters out >90% of the

Re: [GENERAL] How to ignore blank lines with file_fdw

2014-04-22 Thread Albe Laurenz
Nicklas Avén wrote: > I have also found in an email from 2011 > http://www.postgresql.org/message-id/4e699de6.8010...@gmail.com > > that when force_not_null was implemented in file_fdw the patch also included > "some cosmetic changes > such as removing useless blank lines." That is refering to b

Re: [GENERAL] Heartbleed Impact

2014-04-16 Thread Albe Laurenz
Dev Kumkar wrote: >> Unless somebody changes the setting to ssl=on, there should be no problem. > Thanks also please help to understand - does changing this postgresql.conf > setting enough to be > vulnerable here? Just changing the setting will only cause your database server to error out on re

Re: [GENERAL] timezone datetime issue

2014-04-16 Thread Albe Laurenz
Glenn Pierce wrote: > I have a table like > > CREATE TABLE sensor_values > ( > ts timestamp with time zone NOT NULL, > value double precision NOT NULL DEFAULT 'NaN'::real, > ) > > It was intended that ts timestamps would be the time we wanted to store in > UTC. > Clients would adjus

Re: [GENERAL] Heartbleed Impact

2014-04-16 Thread Albe Laurenz
Dev Kumkar wrote: > Can you please let us know about the impact in case binaries are being > shipped and SSL is off? Unless somebody changes the setting to ssl=on, there should be no problem. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

Re: [GENERAL] [GENARAL] round() bug

2014-04-16 Thread Albe Laurenz
Raymond O'Donnell wrote: >>> Interestingly, I get different results (on both 9.1.4 and 9.3.0) on >>> Windows: >> I'm not particularly surprised that Windows is not being IEEE compliant, and >> instead chooses the more common round-away-from-zero behavior, here though I >> am unsure where the depen

Re: [GENERAL] streaming replication + wal shipping

2014-04-15 Thread Albe Laurenz
> Anupama Ramaswamy wrote: >>> I would like to setup a 2 servers with streaming replication, one master >>> and another hot standby. >>> I want to use the standby for read-only queries. So I want the replication >>> lag to be as small as >>> possible. >>> So I choose streaming replication over WA

Re: [GENERAL] CLOB & BLOB limitations in PostgreSQL

2014-04-14 Thread Albe Laurenz
Jack.O'Sullivan wrote: > I am working for a client who is interested in migrating from Oracle to > Postgres. Their database is > currently ~20TB in size, and is growing. The biggest table in this database > is effectively a BLOB > store and currently has around 1 billion rows. > > From reading a

Re: [GENERAL] streaming replication + wal shipping

2014-04-14 Thread Albe Laurenz
Anupama Ramaswamy wrote: > I would like to setup a 2 servers with streaming replication, one master and > another hot standby. > I want to use the standby for read-only queries. So I want the replication > lag to be as small as > possible. > So I choose streaming replication over WAL shipping. >

Re: [GENERAL] openssl heartbleed

2014-04-10 Thread Albe Laurenz
John R Pierce wrote: > On 4/10/2014 1:01 AM, Albe Laurenz wrote: >> If you are in a totally trusted environment, why would you use SSL? > Belt, and suspenders. I guess what I wanted to say was: If you are concerned enough to use SSL, you should be concerned enough to change your

Re: [GENERAL] openssl heartbleed

2014-04-10 Thread Albe Laurenz
Steve Crawford wrote: > On 04/09/2014 08:54 AM, "Gabriel E. Sánchez Martínez" wrote: >> Hi all, >> >> Our server is running Ubuntu Server 13.10 (we will soon upgrade to >> 14.04) and PostgreSQL 9.1. We use certificates for all client >> authentication on remote connections. The server certificat

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

2014-04-08 Thread Albe Laurenz
Thomas Kellerer wrote: > 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=# cr

Re: [GENERAL] Initial queries of day slow

2014-04-08 Thread Albe Laurenz
Rebecca Clarke wrote: > On a side > not, we're not doing a vacuumdb, but individual vacuum analyze statements on > each table. Not sure if > that makes any difference. You vacuum the catalog tables as well, right? Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgr

Re: [GENERAL] Order By and Comparisson

2014-04-07 Thread Albe Laurenz
howardn...@selestial.com wrote: >> http://www.postgresql.org/docs/current/static/collation.html#AEN33298 >> The ordering depends on the collation. Which collations are available >> and how they order depends on your operating system. What is your OS >> and what do you get for SHOW lc_collate; Yours

Re: [GENERAL] Order By and Comparisson

2014-04-07 Thread Albe Laurenz
howardn...@selestial.com wrote: > just as I thought I had postgres mastered :) the ordering of strings is > causing me some confusion. > > Can someone explain how the database orders strings in the ORDER BY command. > > My example: > > My database is encoding is UTF-8, and default language is e

Re: [GENERAL] Initial queries of day slow

2014-04-07 Thread Albe Laurenz
Rebecca Clarke wrote: > I'm a bit stumped. At present I'm finding that queries to my database, that > normally execute promptly, > are taking a long time when they are executed first thing in the morning > (after the database has been > inactive for several hours). After the first execution, ever

Re: [GENERAL] Indices and Foreign Tables

2014-04-04 Thread Albe Laurenz
Kohler Manuel wrote: > I have a question regarding the use of indices when querying foreign data > tables (using postgres_fdw > of 9.3 to another postgres DB). > Everything works fine beside the fact that the indices which are defined in > the foreign DB are not > used at all when I do query it t

Re: [GENERAL] table insert/primary key question

2014-04-04 Thread Albe Laurenz
Scot Kreienkamp wrote: > I have a table like so: > > Receiptlimitid: BIGINT (Primary Key) > Profitcenterid: BIGINT > Receiptnumber: INTEGER > > All are set to Not Null also. > > > My question is, if I have an insert that goes idle in transaction for a while > before it commits, will > it stop

Re: [GENERAL] Insert zero to auto increment serial column

2014-04-02 Thread Albe Laurenz
loc wrote: > I'm currently using an Informix Innovator-C database with Aubit4GL and I > would like to migrate to > PostgreSQL, it looks like the transition will not be too difficult, however > there is one feature that > I would like added to PostgreSQL. Where is the best place to request a > f

Re: [GENERAL] Oracle_FDW - Cache lookup failed

2014-03-28 Thread Albe Laurenz
Emanuel Araújo wrote: > I have a problem wiht Oracle FDW 0.9.10 in PostgreSQL 9.3 > > I am using pg 9.3.4 > > Oracle FDW 0.9.10 > > Fedora 20 > > Client Oracle Release 11.2.0.3.0 > > > Return Error: > > ERROR: cache lookup failed for type 0 This is a known bug, the fix is already committed

Re: [GENERAL] A guide about some topics of Associate Certification

2014-03-26 Thread Albe Laurenz
Oscar Calderon wrote: > Everybody have a nice day. Well, finally the place where i currently work > paid me a chance to take the > Associate Certification exam and i'm reviewing some topics, specifically the > topics that the exam > covers (some of them are easy to me like psql, which i use almos

Re: [GENERAL] Confusing conflicts between OpenJPA and Postgresql

2014-03-24 Thread Albe Laurenz
Vito wrote: > I'm recently doing some research with Apache ODE engine. I use Postgresql as > its external database, > openjpa as its ORM solution and bitronix as its transaction manager. The ODE > workflow engine starts > without any problem. But when I deploy process definition files into the >

Re: [GENERAL] Linux OOM-Killer

2014-03-17 Thread Albe Laurenz
basti wrote: >>> Since a few days we had problems with the Linux OOM-Killer. >>> Some simple query that normally take around 6-7 minutes now takes 5 hours. >>> We did not change any configuration values the last days. >>> >>> First of all I have set >>> >>> vm.overcommit_memory=2 >>> vm.overcommit_

Re: [GENERAL] Plan rows - 1 or many

2014-03-12 Thread Albe Laurenz
Peter Mogensen wrote: > I have an application where I would really like to be able to look at en > SQL query and answer the question: > > "Is this query capable of returning more than 1 row?" > Can I conclude that when plan_rows is 1 then there will never be more > than 1 row returned by the quer

Re: [GENERAL] Extracting data from the view to retrieve the foreign key is not declared

2014-03-11 Thread Albe Laurenz
nill wrote: > Given a view, I need to extract tables, the join columns (ON) . I need to do > this analysis because of the view (agreements with the join condition and > where) I can say that there is a foreign key Do I understand right that you want to find out the tables involved in a view defini

Re: [GENERAL] libpq - lack of support to set the fetch size

2014-03-10 Thread Albe Laurenz
matshyeq wrote: > Postgresql is there for a good while perceived as one of the best (or just > simply the best!?) > available open source DB solution, so I'm really surprised this functionality > is not yet supported... You can retrieve the full result set, you can retrieve it row by row, you ca

Re: [GENERAL] libpq - lack of support to set the fetch size

2014-03-09 Thread Albe Laurenz
Daniel Verite wrote: > matshyeq wrote: [ runs out of memory on the client because all results from a large query are retrieved at once ] >> "Unfortunately, this is a limitation in the underlying driver (libpq) rather >> than DBD::Pg itself. There have been talks over the years of supporting >> t

Re: [GENERAL] Why is varchar_pattern_ops needed?

2014-03-04 Thread Albe Laurenz
Tom Lane wrote: > Albe Laurenz writes: >> Is there anything that "varchar_pattern_ops" is needed for that >> "text_pattern_ops" cannot provide? > > Lack of surprise? If you're creating a pattern index on a varchar column, > you'd likely

[GENERAL] Why is varchar_pattern_ops needed?

2014-03-03 Thread Albe Laurenz
I understand the difference between "*_ops" and "*_pattern_ops". But look at the following: CREATE TABLE test (v varchar(30)); CREATE INDEX test_v_ind ON test (v varchar_pattern_ops); CREATE INDEX test_t_ind ON test (v text_pattern_ops); SET enable_seqscan = off; EXPLAIN VERBOSE SELECT * FROM t

Re: [GENERAL] File system level backup of shut down standby does not work?

2014-02-19 Thread Albe Laurenz
Jürgen Fuchsberger wrote: > One very important thing I just noted when shutting down and restarting > my standby server: > > My standby server *always needs the last WAL-file* from the archive > directory, even when the shut down was "smart". Without this the > consistent recovery state will not b

[GENERAL] Re: could not create lock file postmaster.pid: No such file or directory, but file does exist

2014-02-17 Thread Albe Laurenz
Rob Goethals wrote: > OK, clear. I hereby send this reply also to the list. Cool. >> Interesting. >> How did you get PostgreSQL into this state? Did you set fsync=off or >> similar? >> Which storage did you put pg_xlog on? > 2014-02-15 00:49:04 CET LOG: WAL writer process (PID 1127) was term

[GENERAL] Re: could not create lock file postmaster.pid: No such file or directory, but file does exist

2014-02-17 Thread Albe Laurenz
Rob Goethals wrote: > This is my first post to this list, so I hope I am posting it to the correct > lists. But I am really > stuck and getting pretty desperate at the moment. You should not post to more than one list. > This weekend my database crashed while importing some Openstreetmapdata and

Re: [GENERAL] WAL archive on slave

2014-02-10 Thread Albe Laurenz
James Sewell wrote: > If it is the the only way that I could achieve what I wanted would be to set > wal_keep_segments high enough then they will all be archived on promotion? Even if you set wal_keep_segments high I don't think that the replayed WAL will be archived. > I'm still not sure why the

Re: [GENERAL] client encoding that psql command sets

2014-02-07 Thread Albe Laurenz
[CC'ed -hackers] Tsubasa Sakamoto wrote: >> Not sure that it makes a difference but the docs say psql looks at >> LC_CTYPE not LANG for Unix systems. You did not say what OS you are >> working on though from the examples I am guessing some form of Unix. > The LC_CTYPE environment variable was set

Re: [GENERAL] WAL archive on slave

2014-02-07 Thread Albe Laurenz
James Sewell wrote: > My understanding is that WAL archiving can not be enabled on the slave in a > streaming replication > pair. It can be enabled. Did you try it? > If this is correct, is there a reason behind it? I can see logs showing up in > pg_xlog, so could they > not be archived? Thes

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Albe Laurenz
mephysto wrote: > Is it possible that it is read-uncommitted transaction isolation level? No; there is no such thing in PostgreSQL. The lowest isolation level is READ COMMITTED. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your s

Re: [GENERAL] windows binaries for FDW implementations?

2014-01-31 Thread Albe Laurenz
Chris Curvey wrote: > Is there a trove of Windows installers for FDWs? I'd like to try a > proof-of-concept with the > ODBC_FDW. > > In the meantime, I'll try to go figure out how to go about building from > source on windows, but if I > can avoid that learning curve for my POC, that would be g

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Albe Laurenz
mephysto wrote: > Hi Albe, this is code of my stored function: > CREATE OR REPLACE FUNCTION :FUNCTION_SCHEMA.get_deck_types [...] > BEGIN [...] > CREATE LOCAL TEMPORARY TABLE deck_types > ON COMMIT DROP > AS > SELECT > stored_fu

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Albe Laurenz
mephysto wrote: > in my database I'm using several stored_functions that take advantage of > temporary table. The application that is connected to Postgres is a Java Web > Application in a Glassfish Application Server: it is connected by a JDBC > Connection Pool provided by Glassfish with this sett

Re: [GENERAL] to_date() and invalid dates

2014-01-21 Thread Albe Laurenz
Thomas Kellerer wrote: >>> 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 Albe Laurenz
Thomas Kellerer wrote: > 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. > However in the release notes of 9.2.3[1] it is mentioned that > > - Reject out-of-range dates in to_date() (

Re: [GENERAL] Replication failed after stalling

2013-12-31 Thread Albe Laurenz
Sergey Konoplev wrote: > On Mon, Dec 30, 2013 at 12:27 AM, Albe Laurenz > wrote: >> Joe Van Dyk wrote: >>> If I run "COPY (select * from complicate_view) to stdout" on the standby, >>> I've noticed that sometimes >>> halts replication updat

Re: [GENERAL] Replication failed after stalling

2013-12-30 Thread Albe Laurenz
Joe Van Dyk wrote: > If I run "COPY (select * from complicate_view) to stdout" on the standby, > I've noticed that sometimes > halts replication updates to the slave. > > For example, that's happening right now and "now() - > pg_last_xact_replay_timestamp()" is 22 minutes. > There's many transac

Re: [GENERAL] Upgraded to 9.3

2013-12-27 Thread Albe Laurenz
ERR ORR wrote: > This is just to say that I upgraded from V9.2.6 to V9.3.2. > > Same HW, same data, an astonishing performance increase. > Postgres is flying It lies in the nature of a support mailing list that most of the feedback you get is like "we upgraded, and this and that is much slower no

Re: [GENERAL] inconsistent backup?

2013-12-20 Thread Albe Laurenz
Ralf Schuchardt wrote: > Am 19.Dez. 2013 um 09:41 schrieb Andreas Kretschmer : >> don't ask why, but a customer created tables with foreign key constraints but >> with inconsistent data. >> >> Because of this he disabled all triggers (alter table foo disable trigger >> all). >> So far, so bad ...

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