[GENERAL] How to retrieve values of 'array' field using C library (libpq)

2011-02-09 Thread Anton Maksimenkov
Hi. I use libpq in my program. And I can retrieve int and symbolic fields as simple as int unameFN, moneyFN... char *unamePTR, *moneyPTR... unameFN = PQfnumber(res, "uname"); moneyFN = PQfnumber(res, "money"); unamePTR = PQgetvalue(res, 0, unameFN); moneyPTR = PQgetvalue(res, 0, moneyFN); themo

Re: [HACKERS] [GENERAL] Issues with generate_series using integer boundaries

2011-02-09 Thread Thom Brown
On 9 February 2011 02:11, Robert Haas wrote: > On Tue, Feb 8, 2011 at 8:30 PM, Andrew Dunstan wrote: >> Quite right, but the commitfest manager isn't meant to be a substitute for >> one. Bug fixes aren't subject to the same restrictions of feature changes. > > Another option would be to add this

[GENERAL] Possible Bug

2011-02-09 Thread Kaloyan Iliev Iliev
Hi, I think I found something strange in PostgreSQL behavior. Here is an example: testdb=# CREATE TABLE test1 (test2 text, test3 text); CREATE TABLE testdb=# SELECT A.name FROM test1 A; name -- (0 rows) testdb=# INSERT INTO test1 (test2,test3) VALUES ('1','2'); INSERT 0 1 testdb=# INSERT

[GENERAL] créer une DLL pour Postgresql 9 avec visual C++ [2008]

2011-02-09 Thread michel wildcat
Bonjour à tous, dans le cadre d'un projet académique, je dois développer une extension de postgresql 9 sous windows en utilisant visual C++ express 2008 (souci de compatibilité avec une extension préalablement développée dans le même environnement ) pour créer la DLL qui réalise l'extension. Si j'a

Re: [GENERAL] How to retrieve values of 'array' field using C library (libpq)

2011-02-09 Thread Dmitriy Igrishin
Hey Anton, 2011/2/9 Anton Maksimenkov > Hi. > > I use libpq in my program. And I can retrieve int and symbolic fields > as simple as > > > int unameFN, moneyFN... > char *unamePTR, *moneyPTR... > > unameFN = PQfnumber(res, "uname"); > moneyFN = PQfnumber(res, "money"); > unamePTR = PQgetvalue(re

[GENERAL] Re: [pgsql-fr-generale] créer une DLL pour Postgresql 9 avec visual C++ [2008

2011-02-09 Thread MOQUET Julien PP-DOSTL SDSIC DEPL
Bonjour, Je n'ai personnellement pas rencontré de problème avec postgres 8.3 et visual C++ express 2008 dans le cadre du projet JDONREFv2 (forge Addulact - avec les sources et indications pour compilation sous windows si cela vous intéresse). J'ai toutefois du ajouter le windows sdk pour

[GENERAL] atttypmod encoding

2011-02-09 Thread RW Shore
Catalog pg_attribute contains interesting type-specific information in attribute atttypmod. Can someone verify that these encodings are correct? CHAR and VARCHAR: 4 + the declared length. Example: CHAR(5) -> 9 in atttypmod NUMERIC(p,s): 4 + the long with p in the left-most 4 bytes and s in the rig

Re: [GENERAL] PostgreSQL 9.0 Streaming Replication Configuration

2011-02-09 Thread Ray Stell
On Wed, Feb 09, 2011 at 01:14:05AM -0600, Ogden wrote: > Thank you for letting me know about pg_controldata. I have been playing > around with this tool. > really interesting event/failure last night for me. I started a new thread on the failure in the admin list. my streaming rep without

Re: [GENERAL] Possible Bug

2011-02-09 Thread Robert Gravsjö
On 2011-02-09 10.51, Kaloyan Iliev Iliev wrote: Hi, I think I found something strange in PostgreSQL behavior. Here is an example: testdb=# CREATE TABLE test1 (test2 text, test3 text); CREATE TABLE testdb=# SELECT A.name FROM test1 A; name -- (0 rows) testdb=# INSERT INTO test1 (test2,tes

Re: [GENERAL] tuning postgresql writes to disk

2011-02-09 Thread Vick Khera
On Mon, Feb 7, 2011 at 7:43 PM, Vinubalaji Gopal wrote: > Thank you. I will try to run some performance tests using the async > commit option. Is there an easy way to find the lost transactions or > does it have to be handled by the application? > By definition, your application has to be able to

Re: [GENERAL] Possible Bug

2011-02-09 Thread Adrian Klaver
On Wednesday, February 09, 2011 1:51:38 am Kaloyan Iliev Iliev wrote: > Hi, > I think I found something strange in PostgreSQL behavior. Here is an > example: > > > testdb=# CREATE TABLE test1 (test2 text, test3 text); > CREATE TABLE > testdb=# SELECT A.name FROM test1 A; > name > -- > (0 row

[GENERAL] Why I need to use SETOF TEXT when I'm returning single column?

2011-02-09 Thread hubert depesz lubaczewski
If I'll make my functions like this: create function test( out a text, out b text) returns setof record ... it works well. but if i have just one column in returned recordset, I cannot: create function test( out a text ) returns setof record ... shows: ERROR: function result type must be text be

Re: [GENERAL] pg_restore validation?

2011-02-09 Thread Vick Khera
On Tue, Feb 8, 2011 at 8:06 PM, u235sentinel wrote: > Is there a way we can validate a postgers backup? (short of restoring it > somewhere) > Define "validate" for your purpose. Once you do that, then you can come up with the procedure for accomplishing your validation. Hint: simply restoring

Re: [GENERAL] pg_restore validation?

2011-02-09 Thread u235sentinel
On 02/09/2011 07:52 AM, Vick Khera wrote: On Tue, Feb 8, 2011 at 8:06 PM, u235sentinel > wrote: Is there a way we can validate a postgers backup? (short of restoring it somewhere) Define "validate" for your purpose. Once you do that, then you can come u

Re: [GENERAL] pg_restore validation?

2011-02-09 Thread Raymond O'Donnell
On 09/02/2011 15:10, u235sentinel wrote: On 02/09/2011 07:52 AM, Vick Khera wrote: On Tue, Feb 8, 2011 at 8:06 PM, u235sentinel mailto:u235senti...@gmail.com>> wrote: Is there a way we can validate a postgers backup? (short of restoring it somewhere) Define "validate" for your purpose

Re: [GENERAL] plperl.dll on windows with postgresql 9.0.3

2011-02-09 Thread Robert Fitzpatrick
On 2/8/2011 12:03 PM, Robert Fitzpatrick wrote: > On 2/8/2011 11:58 AM, Robert Fitzpatrick wrote: >> could not load library “C:/Program Files/PostgreSQL/8.3/lib/plperl.dll”: >> The specified module could not be found. SQL state: 58P01 > > Sorry the correct error I am getting is... > > could not l

Re: [GENERAL] pg_dump: schema with OID 58698 does not exist

2011-02-09 Thread David Kerr
On Tue, Feb 08, 2011 at 10:16:02PM -0500, Tom Lane wrote: - David Kerr writes: - > I'm getting the above error in one of my dev DBs. - - Would you poke around in the system catalogs and find where the dangling - reference is located? Have you got any idea of how to reproduce this - failure from

Re: [GENERAL] pg_dump: schema with OID 58698 does not exist

2011-02-09 Thread David Kerr
On Wed, Feb 09, 2011 at 09:42:36AM -0800, David Kerr wrote: - On Tue, Feb 08, 2011 at 10:16:02PM -0500, Tom Lane wrote: - - David Kerr writes: - - > I'm getting the above error in one of my dev DBs. - - - - Would you poke around in the system catalogs and find where the dangling - - reference is

[GENERAL] Will "rename database" get replicated?

2011-02-09 Thread Gauthier, Dave
Hi: Will V9.0.1 streaming replication replicate the effects of "alter database foo rename to fee" ? Will it replicate "analyze" (I do this after a big DB load to give the query optimizer good stats to work with)? If I kill a user on the master (using "pg_ctl kill ABRT procpid"), will that goof

Re: [GENERAL] pg_dump: schema with OID 58698 does not exist

2011-02-09 Thread Tom Lane
David Kerr writes: > Ok, I found the bad entries, 2 tables a sequence and 2 primary key indexes > are associated > with the wrong (invalid / nonexistant ) schema. > However, there are correct entries for those objects as well. So these are > definitly just dangling references. Please be more s

[GENERAL] Relative ordering in array aggregation

2011-02-09 Thread prakashn
I'm using 8.3.3. I came across the array_accum aggregate function in the docs: http://www.postgresql.org/docs/8.3/interactive/xaggr.html CREATE AGGREGATE array_accum (anyelement) ( sfunc = array_append, stype = anyarray, initcond = '{}' ); This would be very useful to me, but I ha

Re: [GENERAL] pg_dump: schema with OID 58698 does not exist

2011-02-09 Thread David Kerr
On Wed, Feb 09, 2011 at 02:15:06PM -0500, Tom Lane wrote: - David Kerr writes: - > Ok, I found the bad entries, 2 tables a sequence and 2 primary key indexes are associated - > with the wrong (invalid / nonexistant ) schema. - - > However, there are correct entries for those objects as well. So

[GENERAL] problematic view definition

2011-02-09 Thread Karsten Hilbert
Hi all ! Attached find some table and view definitions from the GNUmed (www.gnumed.de) database. Unfortunately I do not understand why PostgreSQL says psql:xx.sql:14: ERROR: could not implement UNION DETAIL: Some of the datatypes only support hashing, while others only support

Re: [GENERAL] XML Encoding problem

2011-02-09 Thread Peter Eisentraut
On mån, 2011-02-07 at 12:44 +0100, rsmogura wrote: > I have test database with UTF-8 encoding. I putted there XML > ЁĄ¡, (U+0401, U+0104, U+00A1). I changed client encoding to > iso8859-2, as the result of select I got > ERROR: character 0xd081 of encoding "UTF8" has no equivalent in > "LAT

Re: [GENERAL] problematic view definition

2011-02-09 Thread Karsten Hilbert
I should have mentioned this is on PostgreSQL 8.4.5 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-4) 4.4.5, 32-bit Karsten On Wed, Feb 09, 2011 at 11:12:01PM +0100, Karsten Hilbert wrote: > Date: Wed, 9 Feb 2011 23:12:01 +0100 > From: Karsten Hilbert > To: pgsql-gene

Re: [GENERAL] about PostgreSQL 9.0.3 RPMs

2011-02-09 Thread Devrim GÜNDÜZ
On Tue, 2011-02-08 at 18:45 +0900, OTSUKA Kenji wrote: > > > I searched PostgreSQL 9.0.3 RPMs for RHEL5, but couldn't find them. > I need to them in my business. > They are not yet on the following page. > http://yum.pgrpms.org/9.0/redhat/rhel-5Server-x86_64/ > > When is they available? I up

Re: [GENERAL] Will "rename database" get replicated?

2011-02-09 Thread Guillaume Lelarge
Le 09/02/2011 20:06, Gauthier, Dave a écrit : > Hi: > > Will V9.0.1 streaming replication replicate the effects of "alter database > foo rename to fee" ? Yes. > Will it replicate "analyze" (I do this after a big DB load to give the query > optimizer good stats to work with)? AFAIK, yes. > If

[GENERAL] Compellent SAN, anyone?

2011-02-09 Thread Joshua Tolley
I'm hunting opinions on Compellent (http://www.compellent.com) storage devices and postgres. Comments, anyone? Experiences? Case studies? Success or horror stories? Thanks in advance. -- Joshua Tolley / eggyknap End Point Corporation http://www.endpoint.com signature.asc Description: Digital sig

[GENERAL] Storing Media Types

2011-02-09 Thread Carlos Mennens
I've created a basic table called 'employees' & I've been asked to store a profile photo of all employees. I've looked on Google and the 9.0 documentation but can't find any clear instructions on how I would be to insert photo's stored in a local directory on the server (/var/lib/postgres/data/medi

Re: [GENERAL] Relative ordering in array aggregation

2011-02-09 Thread Tom Lane
praka...@uci.edu writes: > I'm using 8.3.3. I came across the array_accum aggregate function in > the docs: > http://www.postgresql.org/docs/8.3/interactive/xaggr.html > This would be very useful to me, but I have a question about ordering > of values. If I use more than one array_accum in the s

Re: [GENERAL] How to retrieve values of 'array' field using C library (libpq)

2011-02-09 Thread Joshua Tolley
On Wed, Feb 09, 2011 at 02:53:37PM +0300, Dmitriy Igrishin wrote: > > My array is the array of integer values. So maybe there is some native > > method to retrieve them (as in the 'themoney' example)? > > > Not in libpq. Probably, in libpqtypes. I ended up writing one for pgsnmpd, which you're wel

Re: [GENERAL] Storing Media Types

2011-02-09 Thread David Johnston
Photos/Images are binary data and thus should be placed into a "bytea" typed field. As to HOW you would identify and load the binary data that would be depending upon your programming language and user interface. If you are using a traditional programming language you would simply create a parame

Re: [GENERAL] 9.0.X FOR UPDATE|SHARE on Sub-Query Causes "cannot extract system attribute from virtual tuple" if Sub-Query Returns Records (BUG)

2011-02-09 Thread Tom Lane
"David Johnston" writes: > More simply if you run any query of the form: > SELECT subquerycolumn > FROM ( > SELECT subquerycolumn FROM table WHERE [condition] FOR UPDATE -- WHERE > is optional but obviously useful; FOR SHARE also causes this behavior > ) intermediate > The error "cannot extr

[GENERAL] Full text t_tsquery is giving error

2011-02-09 Thread AI Rumman
I am getting the following results: select * from ts_debug('Rumman (AI)'); alias | description | token |dictionaries| dictionary | lexemes ---+-+++--+-- asciiword | Word, all ASCII | Rumman | {syn,english

Re: [GENERAL] XML Encoding problem

2011-02-09 Thread Radosław Smogura
I may write some patch, actually text mode will not be affected, becuase it's text mode, and patch will fail if client encoding is "reacher" then server (one possiblity in this situation is to XML-encode to client encoding, text- rencode to server encoding) But looking at code same thing could o