Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Adrian Klaver
On 11/25/2015 07:47 AM, Yuriy Rusinov wrote: Hello, Colleagues ! I have to transform string, encoded to hexadecimal to text, but if I try to select encode('Qt is great!', 'hex'); I receive valid and correct results 517420697320677265617421 but if I try to select decode

[GENERAL] Convert from hex to string

2015-11-25 Thread Yuriy Rusinov
Hello, Colleagues ! I have to transform string, encoded to hexadecimal to text, but if I try to select encode('Qt is great!', 'hex'); I receive valid and correct results 517420697320677265617421 but if I try to select decode ('517420697320677265617421', 'hex'), I receive the same string, such

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Adrian Klaver
On 11/25/2015 08:56 AM, Francisco Olarte wrote: Hello Yuriy... On Wed, Nov 25, 2015 at 4:47 PM, Yuriy Rusinov wrote: I have to transform string, encoded to hexadecimal to text, but if I try to select encode('Qt is great!', 'hex'); I receive valid and correct results

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Francisco Olarte
Hello Yuriy... On Wed, Nov 25, 2015 at 4:47 PM, Yuriy Rusinov wrote: > I have to transform string, encoded to hexadecimal to text, but if I try to > select encode('Qt is great!', 'hex'); I receive valid and correct results > > 517420697320677265617421 > > but if I try to

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Francisco Olarte
On Wed, Nov 25, 2015 at 6:22 PM, Adrian Klaver wrote: >> 1.- Convert it to a bytea, in a controlled encoding: convert_to(string >> text, dest_encoding name) => bytea >> 2.- Then encode the bytes in hex: encode(data bytea, format text) => text >> >> then, to revert it

Re: [GENERAL] using a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread Jeff Janes
On Mon, Nov 23, 2015 at 2:41 AM, Chris Withers wrote: > Hi All, > > I wondered if any of you could recommend best practices for using a postgres > table as a queue. Roughly speaking, 100-200 workers will vomit rows and > rates of a few hundres per second into the table

Re: [GENERAL] Error creating Tablespace on Windows

2015-11-25 Thread Begin Daniel
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of deepak Sent: November-25-15 17:07 To: John R Pierce Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Error creating Tablespace on Windows I chose temp only for illustration purposes.

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Adrian Klaver
On 11/25/2015 08:56 AM, Francisco Olarte wrote: Hello Yuriy... On Wed, Nov 25, 2015 at 4:47 PM, Yuriy Rusinov wrote: I have to transform string, encoded to hexadecimal to text, but if I try to select encode('Qt is great!', 'hex'); I receive valid and correct results

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Yuriy Rusinov
Thanks a lot. All works fine. On Wed, Nov 25, 2015 at 9:49 PM, Francisco Olarte wrote: > Mail pingpong day. ;-) > > On Wed, Nov 25, 2015 at 7:27 PM, Adrian Klaver > wrote: > > > postgres@latin1_db=# \encoding > > UTF8 > > This does not

Re: [GENERAL] Taking lot time

2015-11-25 Thread Ramesh T
Hi All, 9.3 version using pgadmin3 Query like below,20 columns fetching SELECT col1,col2,col3,...col.20 FROM detail i, adjdetail ia, WHERE i.trans_id = ia.detail_id AND (i.event = ANY

Re: [GENERAL] Taking lot time

2015-11-25 Thread Adrian Klaver
On 11/25/2015 07:46 AM, Ramesh T wrote: First, please take a look at this: https://en.wikipedia.org/wiki/Posting_style Hi All, 9.3 version using pgadmin3 Query like below,20 columns fetching SELECT col1,col2,col3,...col.20 When this thread started you said you where selecting

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Francisco Olarte
Mail pingpong day. ;-) On Wed, Nov 25, 2015 at 7:27 PM, Adrian Klaver wrote: > postgres@latin1_db=# \encoding > UTF8 This does not matter, as you are sending/receiving hex data, and the encoding done when sending query results to you gets reverted when you send

Re: [GENERAL] Error creating Tablespace on Windows

2015-11-25 Thread deepak
I chose temp only for illustration purposes. Actually the regression test "tablespace" fails too, for the same reason, when run from sources (which creates a tablespace directory under src/test/regress) -- Deepak On Wed, Nov 25, 2015 at 2:15 PM, John R Pierce wrote: > On

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Adrian Klaver
On 11/25/2015 10:49 AM, Francisco Olarte wrote: Mail pingpong day. ;-) On Wed, Nov 25, 2015 at 7:27 PM, Adrian Klaver wrote: postgres@latin1_db=# \encoding UTF8 This does not matter, as you are sending/receiving hex data, and the encoding done when sending query

Re: [GENERAL] Taking lot time

2015-11-25 Thread Adrian Klaver
On 11/25/2015 07:46 AM, Ramesh T wrote: Hi All, 9.3 version using pgadmin3 Query like below,20 columns fetching SELECT col1,col2,col3,...col.20 FROM detail i, adjdetail ia,

Re: [GENERAL] using a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread Tim Uckun
I'll add my two cents. I set up something similar a while ago. Here are my suggestions for what they are worth. You don't ever want to delete from such a table so you need to set up something which allows you to truncate the tables when you no longer need them. One way to accomplish this is

[GENERAL] Error creating Tablespace on Windows

2015-11-25 Thread deepak
Hi, I am getting this permission denied error on Windows 2008 trying to create a tablespace. template1=# create tablespace testtablespace location 'c:/windows/temp1/testtablespace'; ERROR: could not set permissions on directory "c:/windows/temp1/testtablespace": Permission denied If I use

Re: [GENERAL] Error creating Tablespace on Windows

2015-11-25 Thread John R Pierce
On 11/25/2015 12:01 PM, deepak wrote: I am getting this permission denied error on Windows 2008 trying to create a tablespace. template1=# create tablespace testtablespace location 'c:/windows/temp1/testtablespace'; ERROR: could not set permissions on directory

Re: [GENERAL] Taking lot time

2015-11-25 Thread Melvin Davidson
Adrian, He never stated what the O/S is. I strongly suspect that he is using PgAdmin to connect to a remote server, which adds another degree of complication. So at the very least, we also need to know if the server is local or remote and what the O/S is. Plus, as you have requested before,

Re: [GENERAL] using a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread George Neuner
On Wed, 25 Nov 2015 23:39:39 -0500, "Steve Petrie, P.Eng." wrote: >Now, I'm reading in this forum that in fact, postgres does not efficiently >automatically recycle storage space released by row DELETion. Yes and no. Space resulting from deleted rows is not given back

Re: [GENERAL] Unexpected behaviour of 'DEFERRABLE INITIALLY DEFERRED'

2015-11-25 Thread Adrian Klaver
On 11/25/2015 04:32 AM, Jong-won Choi wrote: Hi all, This is from my local PostgreSQL log: LOG: statement: begin; LOG: statement: INSERT INTO site_owner (email, name, pwhash, data) VALUES ('xyz', 'xyz', crypt('xyz', gen_salt('bf', 8)), '{}'::JSONB) RETURNING id; LOG: statement: INSERT

Re: [GENERAL] using a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread Jeff Janes
On Wed, Nov 25, 2015 at 8:39 PM, Steve Petrie, P.Eng. wrote: > >> You don't ever want to delete from such a table so you need to set up >> something which allows you to truncate the tables when you no longer need >> them. > > I am migrating a web PHP application (called

Re: [GENERAL] Convert from hex to string

2015-11-25 Thread Francisco Olarte
Hi Adrian: On Wed, Nov 25, 2015 at 9:33 PM, Adrian Klaver wrote: > I will grant you that working with encodings is like working with > timestamps, explicit is better. The thing I am having a problem with is how > not knowing the context of the bytea value is different

Re: [GENERAL] Problems with pg_upgrade after change of unix user running db.

2015-11-25 Thread Benedikt Grundmann
On Tue, Nov 24, 2015 at 8:04 PM, Bruce Momjian wrote: > On Mon, Nov 23, 2015 at 11:12:25AM +, Benedikt Grundmann wrote: > > I got this error trying to upgrade one of our database clusters (happily > in > > testing) from 9.2 to 9.4: > > > > Old and new cluster install users

Re: [GENERAL] What could cause CREATE TEMP... "could not read block" error?

2015-11-25 Thread Albe Laurenz
Chris Richards wrote: [had corruption in pg_depend indexes] > I've observed the problem on other than the "pg_depend" table. A normal table > (called "blocks") had > the problem. A "REINDEX TABLE blocks" did not fix the problem, however a > "VACUUM FULL" did "fix" it. Did you dump/remove

[GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-25 Thread NTPT
Hi, all. I need help. pg_exec(): Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250" It is a strange. First there was a database with latin2 encoding. to this database connect an aplicaton with "set client encoding to

[GENERAL] Unexpected behaviour of 'DEFERRABLE INITIALLY DEFERRED'

2015-11-25 Thread Jong-won Choi
Hi all, This is from my local PostgreSQL log: LOG: statement: begin; LOG: statement: INSERT INTO site_owner (email, name, pwhash, data) VALUES ('xyz', 'xyz', crypt('xyz', gen_salt('bf', 8)), '{}'::JSONB) RETURNING id; LOG: statement: INSERT INTO site (owner, name, timezone, data)

Re: [GENERAL] full_page_writes on SSD?

2015-11-25 Thread NTPT
Hi, I investigate bit about SSD  and how it works and need to be aligned . And I  conclude that in the ideal world we need a  general --ebs=xxx switch in various linux tools to ensure alignment. Or make calculation by had.. On the market there are SSD disks with page size 4 or 8 kb. But

Re: [GENERAL] full_page_writes on SSD?

2015-11-25 Thread Tomas Vondra
On 11/24/2015 08:14 PM, Andres Freund wrote: On 2015-11-24 13:09:58 -0600, Kevin Grittner wrote: On Tue, Nov 24, 2015 at 12:48 PM, Marcin Mańk wrote: if SSDs have 4kB/8kB sectors, and we'd make the Postgres page size equal to the SSD page size, do we still need

Re: [GENERAL] full_page_writes on SSD?

2015-11-25 Thread Tomas Vondra
On 11/24/2015 08:40 PM, John R Pierce wrote: On 11/24/2015 10:48 AM, Marcin Mańk wrote: I saw this: http://blog.pgaddict.com/posts/postgresql-on-ssd-4kb-or-8kB-pages It made me wonder: if SSDs have 4kB/8kB sectors, and we'd make the Postgres page size equal to the SSD page size, do we still

Re: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-25 Thread Albe Laurenz
NTPT wrote: > I need help. > > pg_exec(): Query failed: ERROR: character with byte sequence 0xc2 0x96 in > encoding "UTF8" has no > equivalent in encoding "WIN1250" > > It is a strange. First there was a database with latin2 encoding. > > to this database connect an aplicaton with "set client

Re: [GENERAL] full_page_writes on SSD?

2015-11-25 Thread FarjadFarid(ChkNet)
I am constantly using SSD both on my OS and database and have none of these problems. However I don’t use SSD for O/S’s virtual memory. >From what I have read of this thread. Potentially there could also be a situation that SSD is hitting its limit of auto recovery and has been

[GENERAL] Re: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-25 Thread NTPT
Hi, Thanx for explanation. but how to solve this  in existing  database ? -- Původní zpráva -- Od: Albe Laurenz Komu: 'NTPT *EXTERN*' , pgsql-general@postgresql.org Datum: 25. 11. 2015 12:54:17 Předmět: Re: [GENERAL] Query

Re: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-25 Thread Albe Laurenz
NTPT wrote: > but how to solve this in existing database ? Either update all affected columns in the source database or edit the database dump... Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] RE: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-25 Thread NTPT
but how to update affected columns ? error message does not  provide single  clue ( at least row name) And dump-restore ?  It  do not underestand how it could help.. dumped as unicode  restore as unicode = I am at the same point ... dumping as latin2 and restore to utf8 will end with the some

Re: [GENERAL] Can row level security policies also be implemented for views?

2015-11-25 Thread Stephen Frost
Caleb, * Caleb Meredith (calebmeredi...@gmail.com) wrote: > I'm developing an application where strict control of my data is important. > Views allow me to build a strict custom reading experience, allowing me to > add computed columns and hide private and metadata columns. Row level > security

Re: [GENERAL] "trust" authentication in pg_hba.conf

2015-11-25 Thread Stephen Frost
* Chris Withers (ch...@simplistix.co.uk) wrote: > What's the default contents of pg_hba.conf that postgres ships with? The PG community provides both source code, which is expected to be used by developers and is therefore wide open, and binary packages, which are expected to be used by end users

Re: [GENERAL] Problems with pg_upgrade after change of unix user running db.

2015-11-25 Thread Bruce Momjian
On Wed, Nov 25, 2015 at 08:04:49AM +, Benedikt Grundmann wrote: > You can see the 9.5 requirements in the pg_upgrade function > check_is_install_user().  You might as well just honor what that > requires as you will eventually be moving to 9.5. > > > Thanks I'll try this in one

Re: [GENERAL] using a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread George Neuner
On Wed, 25 Nov 2015 23:39:39 -0500, "Steve Petrie, P.Eng." wrote: >My stupid email client software (Microsoft Outlook Express on Win XP) >refuses to respect its own "Reply" option settings for inline reply text. >I've been looking for a replacement email client but so far

Re: [GENERAL] using a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread Steve Petrie, P.Eng.
(Kindly forgive my top-post. My stupid email client software (Microsoft Outlook Express on Win XP) refuses to respect its own "Reply" option settings for inline reply text. I've been looking for a replacement email client but so far without success.) * * * * * * > You don't ever want to