Re: [GENERAL] documentation for lo_* functions

2014-11-17 Thread Dmitriy Igrishin
Hello Pawel, 2014-11-17 11:55 GMT+03:00 Pawel Veselov : > Hi. > > Where is the proper documentation for lo_* functions (e.g. lo_open) that > are available as SQL functions? I see libpq functions documented in > /static/lo-interfaces.html, but not the SQL ones (from pg_catalog). > Here http://www.

Re: [GENERAL] Integrating C++ singletons into postgresql extensions???

2014-10-18 Thread Dmitriy Igrishin
Hello, 2014-10-18 3:59 GMT+04:00 Stephen Woodbridge : > Hi, > > I've been writing C++ code that needs to get wrapped into a postgresql > extension and it has a few singleton classes like: > > 1. Config object that holds some general configuration information. > 2. Stats object for global stats co

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

2014-09-19 Thread Dmitriy Igrishin
2014-09-15 9:22 GMT+04:00 cowwoc : > Hi, > > Out of curiosity, why is Postgresql's Java support so poor? I am > specifically looking for the ability to write triggers in Java. > I took a look at the PL/Java project and it looked both incomplete and > dead, > yet other languages like Javascript a

Re: [GENERAL] Async IO HTTP server frontend for PostgreSQL

2014-09-10 Thread Dmitriy Igrishin
. But every hardware will has limited resources anyway. And I believe, that for many tasks async solution will help to leverage it to the max. > Regards, > > Allan. > > > > > On Wed, Sep 10, 2014 at 8:25 PM, Dmitriy Igrishin > wrote: > >> Hello, Steve >> >> 2

Re: [GENERAL] Async IO HTTP server frontend for PostgreSQL

2014-09-10 Thread Dmitriy Igrishin
Hello, Steve 2014-09-10 21:08 GMT+04:00 Steve Atkins : > > On Sep 10, 2014, at 12:16 AM, Dmitriy Igrishin wrote: > > > Hello, David > > > > 2014-09-10 4:31 GMT+04:00 David Boreham : > > Hi Dmitriy, are you able to say a little about what's driving your

Re: [GENERAL] Async IO HTTP server frontend for PostgreSQL

2014-09-10 Thread Dmitriy Igrishin
Hello, John 2014-09-10 17:25 GMT+04:00 John DeSoi : > > On Sep 9, 2014, at 7:31 PM, David Boreham wrote: > > > Hi Dmitriy, are you able to say a little about what's driving your quest > for async http-to-pg ? > > I'm curious as to the motivations, and whether they match up with some > of my own

Re: [GENERAL] Async IO HTTP server frontend for PostgreSQL

2014-09-10 Thread Dmitriy Igrishin
Hello, David 2014-09-10 4:31 GMT+04:00 David Boreham : > Hi Dmitriy, are you able to say a little about what's driving your quest > for async http-to-pg ? > I'm curious as to the motivations, and whether they match up with some of > my own reasons for wanting to use low-thread-count solutions. >

Re: [GENERAL] Async IO HTTP server frontend for PostgreSQL

2014-09-09 Thread Dmitriy Igrishin
2014-09-09 1:28 GMT+04:00 Merlin Moncure : > On Mon, Sep 8, 2014 at 12:59 PM, Dmitriy Igrishin > wrote: > > Dear community, > > > > I need a %subj% -- high performance HTTP server solution > > based on asynchronous IO with ability to run PostgreSQL'

[GENERAL] Async IO HTTP server frontend for PostgreSQL

2014-09-08 Thread Dmitriy Igrishin
Dear community, I need a %subj% -- high performance HTTP server solution based on asynchronous IO with ability to run PostgreSQL's functions from HTML templates asynchronously and passing the results to the HTTP client. For example, consider a simple template: ${get_rows(id := :id)} Th

Re: [GENERAL] How to discard partially retrieved result set with the C API?

2014-02-18 Thread Dmitriy Igrishin
2014-02-18 13:44 GMT+04:00 邓尧 : > When single row mode is enabled, after retrieving part of the result set, > I'm no longer interested in the rest of it (due to error handling or other > reasons). How can I discard the result set without repeatedly calling > PQgetResult() in such situation ? > The

Re: [GENERAL] Drop all overloads of a function without knowing parameter types

2014-02-04 Thread Dmitriy Igrishin
2014-02-03 Evan Martin : > Thanks for that "oid::regprocedure" trick! A query like this is fairly > simple once you know it, but completely non-obvious when you don't. > > I'm not sure what conditions others want to search on (couldn't find it in > the list archives), but "by qualified function na

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Dmitriy Igrishin
2014-01-31 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 > >

Re: [GENERAL] Positional parameters and question mark notation

2014-01-20 Thread Dmitriy Igrishin
Hey Andreas, 2014/1/20 Andreas Lubensky > Hi, > > Is there any way to make PostgreSQL support the question mark (?) > notation instead of the dollar sign ($1, $2...) for prepared statements? > Most databases use the question mark notation and we have a set of > simple queries that are supposed

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
In other words, I need to get an information about *current* role of the caller inside the SECURITY DEFINER function. 2013/12/4 Dmitriy Igrishin > > > > 2013/12/4 Pavel Stehule > >> Hello >> >> pls, try session_user >> > Not really :-(. The us

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
2013/12/4 Pavel Stehule > Hello > > pls, try session_user > Not really :-(. The user can perform SET ROLE before calling the SECURITY DEFINER function and I need to know who is the caller at the time of call. I need something like a calling_user() function... -- // Dmitriy.

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
For clarity, is it possible to write a SECURITY DEFINER function which returns a value of current_user at the moment of call? 2013/12/4 Dmitriy Igrishin > Hello, > > Is there are way to determine a subject? > > Thanks. > > -- > // Dmitriy. > > -- // Dmitriy.

[GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
Hello, Is there are way to determine a subject? Thanks. -- // Dmitriy.

Re: [GENERAL] Blowfish Encrypted String

2013-09-26 Thread Dmitriy Igrishin
2013/9/26 Craig Boyd > Hello All, > > I have a string in a program that I have encrypted using Blowfish and I am > now trying to figure out the best way to store that in PostgreSQL so that I > can store it and retrieve it later for decryption. I have searched around > and have not found some goo

Re: [GENERAL] [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-07-13 Thread Dmitriy Igrishin
2013/6/28 Albe Laurenz > Dmitriy Igrishin wrote: > >> Since there can be only one unnamed prepared statement per > >> session, there should be only one such object per connection. > >> It should not get deallocated; maybe it could be private to the > &

Re: [GENERAL] [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-26 Thread Dmitriy Igrishin
2013/6/26 Albe Laurenz > Dmitriy Igrishin wrote: > >> I understand the problem now. > >> I pondered a bit over your design, and I came up with a different > >> idea how to represent prepared statements in a C++ library. > > >> First, a prepared stateme

Re: [GENERAL] [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-25 Thread Dmitriy Igrishin
2013/6/25 Albe Laurenz > Dmitriy Igrishin wrote: > >>>> While developing a C++ client library for Postgres I felt lack of > extra > >>>> information in command tags in the CommandComplete (B) message [...] > > >>> It seems like bad design to me

Re: [GENERAL] Re: [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-24 Thread Dmitriy Igrishin
2013/6/24 Tom Lane > Albe Laurenz writes: > > Why do you need to track prepared statements on the client side? > > The proposed change would fail to allow that anyway; consider the > possibility of a server-side function doing one or more PREPAREs or > DEALLOCATEs. The command tag would be comp

Re: [GENERAL] [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-24 Thread Dmitriy Igrishin
2013/6/24 Albe Laurenz > I'm moving this discussion to -general. > Okay, lets continue here. > > Dmitriy Igrishin wrote: > >>> While developing a C++ client library for Postgres I felt lack of extra > >>> information in command tags in the Comman

Re: [GENERAL] Function tracking

2013-06-07 Thread Dmitriy Igrishin
2013/6/7 Pavel Stehule > Hello > > 2013/6/7 Rebecca Clarke : > > Hi all > > > > 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 da

[GENERAL] Confusing error message.

2013-04-24 Thread Dmitriy Igrishin
Hey, It seems to me, that this is confusing: dmitigr=> create schema test; CREATE SCHEMA dmitigr=> create table test.test(); CREATE TABLE dmitigr=> table "test.test"; ERROR: relation "test.test" does not exist LINE 1: table "test.test"; ^ dmitigr=> table test.test1; ERROR: relatio

Re: [GENERAL] Bug or feature? (The constraint of the domain of extension can be dropped...)

2013-04-05 Thread Dmitriy Igrishin
2013/4/5 Tom Lane > Dmitriy Igrishin writes: > > According to > > http://www.postgresql.org/docs/9.2/static/extend-extensions.html > > "PostgreSQL will not let you drop an individual object contained in an > > extension, except by dropping the whole extension.&q

[GENERAL] Bug or feature? (The constraint of the domain of extension can be dropped...)

2013-04-05 Thread Dmitriy Igrishin
Hey hackers, According to http://www.postgresql.org/docs/9.2/static/extend-extensions.html "PostgreSQL will not let you drop an individual object contained in an extension, except by dropping the whole extension." But this rule does not apply to domain constraints, i.e. it is not possible to drop

Re: [GENERAL] OID of type by name.

2013-04-05 Thread Dmitriy Igrishin
2013/3/29 tahoe-gary > In what version of PG is the 'my_type'::regtype::oid syntax available? I > want to introduce this to the JDBC driver which currently does the most > ridiculous query that totally ignores search path. > > JDBC driver does this currently: SELECT oid FROM pg_catalog.pg_type

Re: [GENERAL] out of memory issue

2013-03-10 Thread Dmitriy Igrishin
04.03.2013 18:25 пользователь "Merlin Moncure" написал: > > On Sun, Mar 3, 2013 at 11:05 AM, G N wrote: > > Hello Friends, > > > > Hope you are all well... > > > > I have a specific issue, where my query fails with below error while trying > > to export data from pgadmin SQL tool. > > > > There

Re: [GENERAL] RAISE NOTICE ... and CONTEXT field of the error report.

2013-01-22 Thread Dmitriy Igrishin
Hey Marc, 2013/1/22 Marc Schablewski > > Am 22.01.2013 14:59, schrieb Dmitriy Igrishin: > > Hey all, > > Is there way to turn off printing of CONTEXT field of the error report > > I think, this might help: > http://www.depesz.com/2008/07/12/suppressing-context-lin

[GENERAL] RAISE NOTICE ... and CONTEXT field of the error report.

2013-01-22 Thread Dmitriy Igrishin
Hey all, Is there way to turn off printing of CONTEXT field of the error report in the following case: create or replace function foo() returns void language plpgsql as $$ begin raise notice 'notice from foo()'; end; $$; create or replace function bar() returns void language plpgsql as $$ begin

Re: [GENERAL] libpq error message deallocation

2012-12-04 Thread Dmitriy Igrishin
2012/12/4 icholy > PQerrorMessage function return char const* > > char const* msg = PQerrorMessage(conn); > > Now since it's const, I don't think I should be deallocating it and I've > never seen that done in any examples. But then, when and how does it get > freed? > > At first I thought it

Re: [GENERAL] pg_listening_channels()

2012-12-01 Thread Dmitriy Igrishin
2012/11/30 Igor Neyman > > -Original Message- > > From: Greg Sabino Mullane [mailto:g...@turnstep.com] > > Sent: Thursday, November 29, 2012 11:34 PM > > To: pgsql-general@postgresql.org > > Subject: Re: pg_listening_channels() > > > > > > On the contrary, it was very well discussed and d

Re: [GENERAL] Creating and managing triggers

2012-10-09 Thread Dmitriy Igrishin
Hey, 2012/10/9 Tom Lane > Dean Myerson writes: > > I need to create some triggers and the docs seem pretty straightforward. > > When I tried to create one using CREATE TRIGGER, it took over 20 > > minutes, and the second one hadn't finished over more than an hour. And > > I later found that all

Re: [GENERAL] Moving several databases into one database with several schemas

2012-09-07 Thread Dmitriy Igrishin
2012/9/7 Merlin Moncure > On Thu, Sep 6, 2012 at 10:12 PM, Edson Richter > wrote: > > Em 06/09/2012 15:40, John R Pierce escreveu: > > > >> On 09/06/12 5:30 AM, Edson Richter wrote: > > You could change the default setting for the user with > > ALTER ROLE someuser SET search_

Re: [GENERAL] PQfformat question and retrieving bytea data in C

2012-08-30 Thread Dmitriy Igrishin
2012/8/30 Albe Laurenz > Jason Armstrong wrote: > > I have updated my C library to return the binary data correctly. I > > note the restriction on not being able to retrieve different columns > > in different formats. > > Actually, PostgreSQL supports that if you use the line protocol > to talk t

Re: [GENERAL] C locale versus en_US.UTF8. (Was: String comparision in PostgreSQL)

2012-08-29 Thread Dmitriy Igrishin
2012/8/29 Merlin Moncure > On Wed, Aug 29, 2012 at 12:43 PM, Bruce Momjian wrote: > > On Wed, Aug 29, 2012 at 10:31:21AM -0700, Aleksey Tsalolikhin wrote: > >> On Wed, Aug 29, 2012 at 9:45 AM, Merlin Moncure > wrote: > >> > citext unfortunately doesn't allow for index optimization of LIKE > >>

Re: [GENERAL] Views versus user-defined functions: formatting, comments, performance, etc.

2012-08-29 Thread Dmitriy Igrishin
2012/8/29 Merlin Moncure > On Tue, Aug 28, 2012 at 3:25 PM, Dmitriy Igrishin > wrote: > > 2012/8/20 Merlin Moncure > >> > >> On Sun, Aug 19, 2012 at 8:14 AM, Dmitriy Igrishin > >> wrote: > >> >> For various reasons, this often goes the w

Re: [GENERAL] PQfformat question and retrieving bytea data in C

2012-08-29 Thread Dmitriy Igrishin
Hey Jason, 2012/8/29 Jason Armstrong > I have a question regarding the return value of PQfformat() > > I have a 'data' column in my table, type bytea (postgresql 9.1.5). > > In postgresql.conf: > bytea_output = 'escape' > > When I execute the query: > PGresult *res = PQexec(db, "SELECT data::byt

Re: [GENERAL] Views versus user-defined functions: formatting, comments, performance, etc.

2012-08-28 Thread Dmitriy Igrishin
2012/8/20 Merlin Moncure > On Sun, Aug 19, 2012 at 8:14 AM, Dmitriy Igrishin > wrote: > >> For various reasons, this often goes the wrong way. Views are often > >> the right way to go. +1 on your comment above -- the right way to do > >> views (and SQL in ge

Re: [GENERAL] Question about granting permissions

2012-08-26 Thread Dmitriy Igrishin
Hey Matvey, 2012/8/26 Matvey Teplov > Hi, > > Sorry to bother with the stupid question guys - I'm new to the Postgres. > I'm having issue allowing user to access the database - the user is > not allowed to access the data. I do the following: > 1) grant all on database testdb table mytable to

Re: [GENERAL] Views versus user-defined functions: formatting, comments, performance, etc.

2012-08-19 Thread Dmitriy Igrishin
2012/8/18 Merlin Moncure > On Fri, Aug 17, 2012 at 5:44 PM, Tom Lane wrote: > > Adam Mackler writes: > >> I notice when I save a view, I lose all the formatting and comments. > >> As I was writing a complicated view, wanting to retain the format and > >> comments, I thought I could just save it

Re: [GENERAL] Field size

2012-08-16 Thread Dmitriy Igrishin
Hey aliosa 2012/8/16 aliosa > Hello > I am using libpq to find information about fileds of table ( type and > size). > I have a problem with getting the sizeof varchar fields. > If a table has a fiels varchar[35] and want to obtain 35. > I used PQgetlength or PQfsize but is not good for my work

[GENERAL] Determining a table column by the view column.

2012-08-14 Thread Dmitriy Igrishin
Hey all, Is there way to determine a table column referenced by a view column via SQL? I want to create an universal function to determine mandatoriness of some column of the view (i.e. check the not null constraint of underlying table column). Thanks. -- // Dmitriy.

Re: [GENERAL] Roles with empty password (probably bug in libpq and in psql as well).

2012-07-24 Thread Dmitriy Igrishin
2012/7/24 Tom Lane > Dmitriy Igrishin writes: > > 2012/7/24 Tom Lane > >> Please note that empty and null are not the same thing... > > > Yes, I know. But why the ALTER ROLE treats '' as NULL and > > as the result all of values of pg_catalog.pg_au

Re: [GENERAL] Roles with empty password (probably bug in libpq and in psql as well).

2012-07-24 Thread Dmitriy Igrishin
2012/7/24 Tom Lane > Dmitriy Igrishin writes: > > But it's impossible to pass empty (NULL) password to the backend > > Please note that empty and null are not the same thing... > Yes, I know. But why the ALTER ROLE treats '' as NULL a

Re: [GENERAL] Roles with empty password (probably bug in libpq and in psql as well).

2012-07-24 Thread Dmitriy Igrishin
2012/7/24 Dmitriy Igrishin > > > 2012/7/24 Guillaume Lelarge > >> On Tue, 2012-07-24 at 17:36 +0400, Dmitriy Igrishin wrote: >> > Hey Guillaume, >> > >> > 2012/7/24 Guillaume Lelarge >> > On Tue, 2012-07-24 at 16:41

Re: [GENERAL] Roles with empty password (probably bug in libpq and in psql as well).

2012-07-24 Thread Dmitriy Igrishin
2012/7/24 Guillaume Lelarge > On Tue, 2012-07-24 at 17:36 +0400, Dmitriy Igrishin wrote: > > Hey Guillaume, > > > > 2012/7/24 Guillaume Lelarge > > On Tue, 2012-07-24 at 16:41 +0400, Dmitriy Igrishin wrote: > > > Hey all, > > >

Re: [GENERAL] Roles with empty password (probably bug in libpq and in psql as well).

2012-07-24 Thread Dmitriy Igrishin
Hey Guillaume, 2012/7/24 Guillaume Lelarge > On Tue, 2012-07-24 at 16:41 +0400, Dmitriy Igrishin wrote: > > Hey all, > > > > According to > http://www.postgresql.org/docs/9.2/static/sql-alterrole.html > > > > A query: > > ALTER ROLE davide WITH PA

[GENERAL] Roles with empty password (probably bug in libpq and in psql as well).

2012-07-24 Thread Dmitriy Igrishin
Hey all, According to http://www.postgresql.org/docs/9.2/static/sql-alterrole.html A query: ALTER ROLE davide WITH PASSWORD NULL; removes a role's password. But it's impossible to pass empty (NULL) password to the backend by using libpq, because connectOptions2() defined the fe-connect.c reads a

Re: [GENERAL] How to declare return type for a function returning several rows and columns?

2012-06-12 Thread Dmitriy Igrishin
Hey Alexander, 2012/6/12 Alexander Farber > Hello, > > I'm trying to create the following function which gives me > a runtime error, because it obviously doesn't return a mere > integer but several rows and columns (result of a join): > > # create or replace function pref_daily_misere() returns

Re: [GENERAL] how to for loop with distinct values?

2012-05-22 Thread Dmitriy Igrishin
2012/5/22 Merlin Moncure > On Mon, May 21, 2012 at 3:39 PM, J.V. wrote: > > > > I am banging my head over this. I want to select distinct values from a > > varchar column and iterate through the values. > > > > I want to select the distinct values from this column and loop through > them > > (u

Re: [GENERAL] Confusion about composite indexes

2012-05-21 Thread Dmitriy Igrishin
2012/5/22 Merlin Moncure > On Mon, May 21, 2012 at 2:34 PM, Bill Mitchell > wrote: > > I am searching for some logic behind the selection of an index in > postgres > > -- it seems that if I have a composite index based on both columns in a > join > > table, it's only referenced if I query on the

[GENERAL] Frontend/Backend protocol question.

2012-03-13 Thread Dmitriy Igrishin
Hey all, According to http://www.postgresql.org/docs/9.1/static/protocol-flow.html#AEN91458 "is not actually necessary for the frontend to wait for ReadyForQuery before issuing another command". But is it necessary for frontend to wait for ReadyForQuery before sending Describe message? Or is it n

[GENERAL] Unambiguous identification of the cluster.

2012-02-11 Thread Dmitriy Igrishin
Hey all, Is there are way to uniquely identify the cluster? May be some identificator such as UUID? PS. I need to unambiguous identify the database. There are current_catalog (and current_database()) function. There are also inet_server_addr() and inet_server_port() functions, but these functions

Re: [GENERAL] Index on parent/child hierarchy

2012-01-29 Thread Dmitriy Igrishin
Hey, 2012/1/25 Merlin Moncure > On Wed, Jan 25, 2012 at 5:54 AM, Jason Armstrong > wrote: > > Hi > > > > I'm looking for advice on the best way to index a table that is defined > as: > > > > create table uuid.master(id uuid, parent uuid references > > uuid.master(id), type_id smallint, primary

Re: [GENERAL] On duplicate ignore

2012-01-18 Thread Dmitriy Igrishin
Hey Gnanakumar, 2012/1/18 Gnanakumar > > Just create a unique index on EMAIL column and handle error if it comes > > Thanks for your suggestion. Of course, I do understand that this could be > enforced/imposed at the database-level at any time. But I'm trying to find > out whether this could b

Re: [GENERAL] Pgsql problem

2012-01-12 Thread Dmitriy Igrishin
Hey pasman, 2012/1/12 pasman pasmański > Hi. > > I write function in pgsql. This function needs > to execute other functions by name. > I do it using loop: > > declare r record; > begin > for r in execute 'select ' || $1 || '()' > loop > end loop; > > But I can't convert a record to array of t

Re: [GENERAL] Keywords

2012-01-11 Thread Dmitriy Igrishin
Hey vyang, 2012/1/11 vyang > Hello List, > > I’m wondering if there is a way to retrieve/query PostgreSQL for a list of > key words matching that of Appendix C. SQL Key Words. I’m using PostgreSQL > 9.1 and java. I’ve already tried java’s DatabaseMetaData.getSQLKeywords, > but the API states

Re: [GENERAL] How to code lo_creat & lo_write & lo_read in non-blocking mode

2012-01-07 Thread Dmitriy Igrishin
Hey ChoonSoo, 2012/1/6 ChoonSoo Park > I just wonder if there is a way to program lo client interfaces (lo_creat, > lo_write, lo_read) in non-blocking mode. > PQsendQueryParams works perfect for executing a sql command in > non-blocking mode. But I couldn't find a way for handling large objects.

Re: [GENERAL] PQexecParams with binary resultFormat vs BINARY CURSOR

2011-11-11 Thread Dmitriy Igrishin
2011/11/11 Mateusz Łoskot > Hi Dmitriy, > > 2011/11/11 Dmitriy Igrishin : > > 2011/11/11 Mateusz Łoskot > >> > >> Considering query for binary data stored directly in tables > >> using libpq API, I'm trying to understand what is the difference >

Re: [GENERAL] PQexecParams with binary resultFormat vs BINARY CURSOR

2011-11-11 Thread Dmitriy Igrishin
Hey Mateusz, 2011/11/11 Mateusz Łoskot > Hi, > > Considering query for binary data stored directly in tables > using libpq API, I'm trying to understand what is the difference > between specifying binary format in functions like > PQexecParams and use of BINARY CURSOR. > > For example, with quer

Re: [GENERAL] Client-site "lo_export"

2011-10-28 Thread Dmitriy Igrishin
Hey, 2011/10/28 whiplash > Hello! > > I use client-side "lo_export" for save large object to file. If i login as > database owner then i do not have error (output file exists), but if i login > as not database owner then function "lo_export" returning -1. My code is > simple: > > PGresult *res

Re: [GENERAL] 9.1 got really fast ;)

2011-10-16 Thread Dmitriy Igrishin
2011/10/16 John R Pierce > On 10/15/11 1:59 PM, Chris Travers wrote: > >> Are you saying that Windows XP is the ultimate server OS for high >> performance PostgreSQL installations? Are there optimizations that this >> platform can take advantage of, perhaps extending Pg timelines into actual >>

Re: [GENERAL] bytea columns and large values

2011-10-01 Thread Dmitriy Igrishin
2011/10/2 Merlin Moncure > On Sat, Oct 1, 2011 at 4:27 AM, Dmitriy Igrishin > wrote: > > Hey Merlin, > > > >> The lo interface sucks but it's slightly better on resources for > >> really huge bytea and tends to be more consistently implemented in >

Re: [GENERAL] bytea columns and large values

2011-10-01 Thread Dmitriy Igrishin
Hey Merlin, The lo interface sucks but it's slightly better on resources for > really huge bytea and tends to be more consistently implemented in > database drivers. If I was doing this, I would of course be crafting > a carefully generated client in C, using libpqtypes, which is the gold > stand

[GENERAL] Millions of largeobjects the production databases.

2011-09-20 Thread Dmitriy Igrishin
Hey Community, Just curious, is there are heavily loaded servers with databases in production with tons (millions) of largeobjects (pics, movies)? Theoretically, everything should be fine with it, but it is always interesting to know how things works in practice. Thanks! -- // Dmitriy.

Re: [GENERAL] Parameterized prepared statements

2011-09-04 Thread Dmitriy Igrishin
Hey Craig, Things like pre-parsed prepared statements that're re-planned on every > execution are often proposed as solutions to this. This has me wondering: > rather than expensively re-planning from scratch, would it be possiblet to > adjust the planning process so that *multiple* alternative pl

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dmitriy Igrishin
2011/8/18 s...@bestmx.ru > Dmitriy Igrishin пишет: > >> >> >> 2011/8/18 s...@bestmx.ru <mailto:s...@bestmx.ru> > s...@bestmx.ru>> >> >>Dmitriy Igrishin пишет: >> >> >> >>2011/8/18 s...@bestmx.ru <

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dmitriy Igrishin
2011/8/18 s...@bestmx.ru > Dmitriy Igrishin пишет: > >> >> >> 2011/8/18 s...@bestmx.ru <mailto:s...@bestmx.ru> > s...@bestmx.ru>> >> >> >>Merlin Moncure пишет: >> >>On Thu, Aug 18, 2011 at 5:48 AM

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dmitriy Igrishin
2011/8/18 s...@bestmx.ru > Merlin Moncure пишет: > > On Thu, Aug 18, 2011 at 5:48 AM, Dimitri Fontaine >> wrote: >> >>> c k writes: >>> Many users are using it and found it stable and scalable. Important is that web server is external to the database and a mod_pgsql like mod_pl

Re: [GENERAL] TRUNCATE pg_largeobject

2011-07-25 Thread Dmitriy Igrishin
Hey Tamas, 2011/7/25 Tamas Vincze > Is it safe? > > This table is around 500GB and because of performance reasons > I slowly moved all large objects to regular files on a NetApp > share. > > Now it shows 0 records: > > # select count(*) from pg_largeobject; > count > --- > 0 > (1 row) >

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-03 Thread Dmitriy Igrishin
Hey Alban, 2011/7/3 Alban Hertroys > On 3 Jul 2011, at 16:10, Dmitriy Igrishin wrote: > > > "you MUST lock on insert to get gapless sequences" > > Not me :-). The OP must do it. So, what problem here? Deadlocks? > > Again, if deadlocks are so dangerous, why the

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-03 Thread Dmitriy Igrishin
Hey Vincent, 2011/7/3 Vincent Veyron > Le vendredi 01 juillet 2011 à 12:28 +0400, Dmitriy Igrishin a écrit : > > > > Then I don't clearly understand the existence of locks (the LOCK > > command, SELECT FOR UPDATE clause and so on) if the usage > > of them give

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-01 Thread Dmitriy Igrishin
2011/7/1 Chris Travers > On Fri, Jul 1, 2011 at 1:16 AM, Dmitriy Igrishin > wrote: > > Hey Chris, > > > >> The suggestion of using for > >> update is a good one, but it doesn't entirely get rid of the problem, > >> which is inherent in ensuring

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-07-01 Thread Dmitriy Igrishin
Hey Chris, The suggestion of using for > update is a good one, but it doesn't entirely get rid of the problem, > which is inherent in ensuring gapless numbering in a system with > concurrent transactions. > Why not? I mean the following solution: CREATE TABLE myseq(tabnm text not null, lastid in

Re: [GENERAL] How to create "auto-increment" field WITHOUT a sequence object?

2011-06-30 Thread Dmitriy Igrishin
Hey Dmitry, 2011/6/30 Dmitry Koterov > Hello. > > I need to create an auto-increment field on a table WITHOUT using > sequences: > > CREATE TABLE tbl( > name TEXT, > uniq_id INTEGER > ); > > Each INSERT to this table must generate a new uniq_id which is distinct > from all others. > > The pr

Re: [GENERAL] PostgreSQL 9.0 users

2011-06-11 Thread Dmitriy Igrishin
Hey Zhidong, 2011/6/11 Zhidong She > Hi all, > > Could you please give us some typical users that already upgraded to > version 9.0? > We have a debate internally on choosing 8.4 or 9.0 as our product > backend database. > > We are switched our current development from 9.0 to 9.1 beta already wi

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Dmitriy Igrishin
2011/4/28 Dmitriy Igrishin > > > 2011/4/28 Thomas Larsen Wessel > >> Thanks a lot :) >> >> Both of the following work >> >> UPDATE foo SET bar = (bar::float * 2); >> removes trailing zeros on the decimal side, if no decimals dont show any >

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Dmitriy Igrishin
Apr 28, 2011 at 12:18 PM, Vibhor Kumar < > vibhor.ku...@enterprisedb.com> wrote: > >> >> On Apr 28, 2011, at 3:41 PM, Dmitriy Igrishin wrote: >> >> > Only one point, Vibhor. I believe that varchar data type was chosen for >> > exact storage of nu

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Dmitriy Igrishin
2011/4/28 Vibhor Kumar > > On Apr 28, 2011, at 3:22 PM, Dmitriy Igrishin wrote: > > > NB: I am sure that OP is not sure :-) And since foo.bar is varchar, > > it is better to use numeric instead of float :-) > > > Now, this make to ask question, why numeric? How its

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Dmitriy Igrishin
2011/4/28 Thomas Larsen Wessel > I have a table with the following schema: > CREATE TABLE foo (bar VARCHAR(32)); > > Every bar value has a format like a float, e.g. "2.5". Now I want that > value multiplied by two and saved again as varchar. I was hoping to do smth > like: > > UPDATE foo SET bar

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Dmitriy Igrishin
2011/4/28 Vibhor Kumar > > On Apr 28, 2011, at 2:56 PM, Thomas Larsen Wessel wrote: > > > UPDATE foo SET bar = TO_VARCHAR( TO_FLOAT(bar) * 2); -- INCORRECT > > If you are sure bar contains float value, then try following: > UPDATE foo SET bar = bar::float * 2; > NB: I am sure that OP is not

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Dmitriy Igrishin
2011/4/28 Thomas Larsen Wessel > I have a table with the following schema: > CREATE TABLE foo (bar VARCHAR(32)); > > Every bar value has a format like a float, e.g. "2.5". Now I want that > value multiplied by two and saved again as varchar. I was hoping to do smth > like: > > UPDATE foo SET bar

Re: [GENERAL] Global Variables in plpgsql

2011-04-11 Thread Dmitriy Igrishin
Hey Nick, 2011/4/11 Nick Raj > Hi, > Can anyone know how to define global variable in plpgsql? > Thanks > Why if you are already inside a database system ? :-) Just use tables. > > Regards, > Raj > > -- // Dmitriy.

Re: [GENERAL] Stange IO error while working with large objects.

2011-03-30 Thread Dmitriy Igrishin
Hey Merlin, 2011/3/30 Merlin Moncure > On Wed, Mar 30, 2011 at 7:37 AM, Dmitriy Igrishin > wrote: > > I've checked the disk with badblocs(8). The results are: > > > > File /pgsql/9.0/data0/base/16386/11838.5 (inode #3015588, mod time Wed > Mar > > 3

Re: [GENERAL] Stange IO error while working with large objects.

2011-03-30 Thread Dmitriy Igrishin
ropped the database and create a new one. Problem is solved. All the same it is interesting, why there was such problem? I am disturbed because I intend to use large objects in production... Suggestions ? 2011/3/30 Dmitriy Igrishin > Hey all, > > I've never experienced such problems befo

[GENERAL] Stange IO error while working with large objects.

2011-03-30 Thread Dmitriy Igrishin
Hey all, I've never experienced such problems before pefrorming some tests on large objects. I am on Ubuntu and my HDD is whole encrypted (LVM2). I've imported large object ~ 1.5 Gb of size. After this, entire system lost performance dramaticaly and the disk activity becomes anomalous. After rebo

Re: [GENERAL] Maximum number of tables

2011-03-16 Thread Dmitriy Igrishin
Hey Manos, 2011/3/16 Manos Karpathiotakis > Let me explain a few things about our dataset. We are using a system named > Sesame [1] that stores and queries RDF data. In our case, it uses Postgres > as a relational backend. In RDF, data are triples. Here is an example of an > RDF triple: > > ex:P

Re: [GENERAL] Values larger than 1/3 of a buffer page cannot be indexed.

2011-03-13 Thread Dmitriy Igrishin
Hey Viktor, 2011/3/13 Viktor Nagy > hi, > > when trying to insert a long-long value, I get the following error: > > index row size 3120 exceeds maximum 2712 for index "ir_translation_ltns" > HINT: Values larger than 1/3 of a buffer page cannot be indexed. > Consider a function index of an MD5

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-11 Thread Dmitriy Igrishin
2011/3/11 Merlin Moncure > On Thu, Mar 10, 2011 at 4:13 PM, Dmitriy Igrishin > wrote: > > 2011/3/9 John R Pierce > >> > >> On 03/08/11 5:06 PM, Reece Hart wrote: > >>> > >>> I'm considering porting a MySQL database to PostgreSQL.

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-10 Thread Dmitriy Igrishin
2011/3/9 John R Pierce > On 03/08/11 5:06 PM, Reece Hart wrote: > >> I'm considering porting a MySQL database to PostgreSQL. That database uses >> MySQL's SET type. Does anyone have advice about representing this type in >> PostgreSQL? >> >> MySQL DDL excerpt: >> CREATE TABLE `transcript_variatio

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-10 Thread Dmitriy Igrishin
2011/3/10 Bruce Momjian > Dmitriy Igrishin wrote: > > dmitigr=> SELECT '>'||to_char(0.1, '0.9')||'<' AS v; > > v > > > > > 0.1< > > > > dmitigr=> SELECT '>'||to_char(0

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Adrian Klaver > On 03/09/2011 09:59 AM, Dmitriy Igrishin wrote: > >> >> >> 2011/3/9 Adrian Klaver > <mailto:adrian.kla...@gmail.com>> >> >> >>On Wednesday, March 09, 2011 5:34:41 am Dmitriy Igrishin wrote: >> >>

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Adrian Klaver > On Wednesday, March 09, 2011 5:34:41 am Dmitriy Igrishin wrote: > > > > > But I am missing something or there is a documentation inaccuracy: > > > http://www.postgresql.org/docs/9.0/static/functions-formatting.html#FUNCTIO > > NS-FORM

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Sim Zacks > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 03/09/2011 03:12 PM, Dmitriy Igrishin wrote: > > > Hey all, > > > > dmitigr=> select to_char(1, '9'); > > to_char > > - > > 1 > > &g

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Pavel Stehule > 2011/3/9 Dmitriy Igrishin : > > > > > > 2011/3/9 Pavel Stehule > >> > >> 2011/3/9 Dmitriy Igrishin : > >> > Hey all, > >> > > >> > dmitigr=> select to_char(1, '9'); > &g

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Pavel Stehule > 2011/3/9 Dmitriy Igrishin : > > Hey all, > > > > dmitigr=> select to_char(1, '9'); > > to_char > > - > > 1 > > > > dmitigr=> select length(to_char(1, '9')); > > length > >

[GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
Hey all, dmitigr=> select to_char(1, '9'); to_char - 1 dmitigr=> select length(to_char(1, '9')); length 2 Why to_char() includes preceding blank space in the result ? -- // Dmitriy.

Re: [GENERAL] Why count(*) doest use index?

2011-03-07 Thread Dmitriy Igrishin
2011/3/8 Merlin Moncure > On Mon, Mar 7, 2011 at 3:16 PM, Glenn Maynard wrote: > > On Mon, Mar 7, 2011 at 1:13 PM, Merlin Moncure > wrote: > >> > >> On Sun, Mar 6, 2011 at 2:57 PM, Glenn Maynard wrote: > >> > That's often perfectly fine, with read-heavy, single-writer workloads. > >> > > >> >

  1   2   3   >