[SQL] UTF8 Vs Latin9 and valid encoding.

2006-08-29 Thread Marcelo .

Hello,
I am using postgres 8.1 for windows and have the
following dilema.

I have 2 databases, one encoded in UTF-8 and one in
Latin9.
In both DBs I can create the following test table:

CREATE TABLE "holaniño"
(
  nombre varchar(5),
  "titúlo" varchar(10)
) 
WITHOUT OIDS;

Then in both DBs I can execute the following SQL:

select * from holaniño where titúlo = 'compania'

HOWEVER, when I change the SQL to:
select * from holaniño where titúlo = "compañia"

(changed the N to a Ñ in the filter)
I receive the error msg:
ERROR:  invalid UTF-8 byte sequence detected near byte
0xf1

Where in the LATIN9 db, there is no problem.

Isn't UTF-8 the same as UNICODE where it encapsulates
all other coding schemes including latin9?

Any insight would be greatly apreciated.





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [SQL] UTF8 Vs Latin9 and valid encoding.

2006-08-30 Thread Marcelo .
Hello,
Thanks for your reply.
When I execute
show client_encoding;
I get UNICODE.

However, up to know I was using pgAdmin III Query and
EMS... you gave me the idea to use psql, where I
noticed something interesting:

\encoding
UTF8

show client_encoding;
UTF8

So this seems to be OK..
However when I type áéíóúñ on screen I see ߨ«·±
Why would this be?

Thanks again


--- Markus Schaber <[EMAIL PROTECTED]> wrote:

> Hi, Marcelo,
> 
> Marcelo . wrote:
> 
> > I receive the error msg:
> > ERROR:  invalid UTF-8 byte sequence detected near
> byte
> > 0xf1
> > 
> > Isn't UTF-8 the same as UNICODE where it
> encapsulates
> > all other coding schemes including latin9?
> 
> Yes, it is.
> 
> But it seems that your client and the server
> disagree on the encoding
> they use.
> 
> I think the problem is that your client (psql, I
> presume) uses latin9 to
> communicate with the server, but the server assumes
> the client uses utf8.
> 
> in psql, you can use \encoding to show the encoding
> psql uses, and "show
> client_encoding;" to show the encoding the server
> thinks the client uses.
> 
> Try one of:
> 
> SET client_encoding TO LATIN9; -- Tell server:
> client uses latin9
> 
> \encoding LATIN9; -- Set clients encoding
> 
> You can also set UTF-8 here, the server will convert
> between the client
> and database encoding (but it needs to know).
> 
> HTH,
> Markus
> 
> 
> 
> -- 
> Markus Schaber | Logical Tracking&Tracing
> International AG
> Dipl. Inf. | Software Development GIS
> 
> Fight against software patents in EU! www.ffii.org
> www.nosoftwarepatents.org
> 
> ---(end of
> broadcast)---
> TIP 1: if posting/reading through Usenet, please
> send an appropriate
>subscribe-nomail command to
> [EMAIL PROTECTED] so that your
>message can get through to the mailing list
> cleanly
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[SQL] How to display a unixtimestamp from a timestamp record?

2001-01-15 Thread Marcelo Bartsch

Hello!
again i was faced to a problem i was trying to do create view in wich i
had the next fields:

CREATE TABLE "tbacct" (
"user_name" character varying(32),
"nas_identifier" character varying(15),
"nas_port" int4,
"acct_session_id" character varying(15),
"caller_id" character varying(16),
"called_station_id" character varying(16),
"framed_ip_address" character varying(15),
"acct_disconnect_cause" character varying(40),
"acct_session_time" int4,
"acct_timestamp" timestamp,
"realm" character varying(64)
);

and i need view in wich acct_timestamp is a int8

USERNAME
IP-ADDRESS
74
000B2E5B
NULL
6572
IP-ADDRESS
NULL
4
2000-11-13 14:19:45-03
REALM

and i want it to be displayed something like this:

USERNAME
IP-ADDRESS
74
000B2E5B
NULL
6572
IP-ADDRESS
NULL
4
974135985
REALM

i know it is possible using date_part
select date_part( 'epoch' , timestamp '2000-11-13 14:30:40');
gave the right answer . but when i executte

 select user_name, date_part( 'epoch' , timestamp 'acct_timestamp') from
tbacct limit 2;

it said ERROR:  Bad timestamp external representation 'acct_timestamp'
how should i represent date_part( 'epoch' , timestamp 'acct_timestamp')
to work?

Thanks in Advance

-- 
Marcelo Bartsch R.
[EMAIL PROTECTED]
PSINet Chile

/O /Ot Minimize execution speed (default)
Microsoft C/C++ Compiler Documentation,
'Enviroment and Tools', p531

Telefono : +56-2-3979000
Numero de Fax: +56-2-3979090
Numero de eFax   : (815) 366-3177



[SQL] Problem with VACUUM

2003-02-05 Thread Marcelo Pereira Tada
Hello everybody!

We have a problem with VACUUM FULL and the our PostgresSQL is very slow.

On the try run the vacuum command, its returns:


NOTICE:  Child itemid in update-chain marked as unused - can't continue repair_frag
ERROR:  No one parent tuple was found
vacuumdb: vacuum  nube failed


I think it looking for a table or an atributte of inherits but we have already droped it.

The PostgresSQL version is: 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96

Thanks

Marcelo.





---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] Delete a FOREIGN KEY

2002-07-30 Thread Marcelo Henrique da Silva



Hi All,
 
I'm beginner in PostgreSQL!
So, how can I delete a FOREIGN KEY in 
PostgreSQL?
 
Thanks.
 
Marcelo Henrique da 
Silva.


[SQL] using string functions on plpgsql

2008-04-16 Thread Marcelo Edgardo Paniagua Lizarraga
I'm starting to create my firsts plpgsql functions, and I was
wondering how to use the string function 'length' in the code of the
fuction. I have tried so far and I get an error. I'm trying this:

declare
i integer;
begin
 ...

   i =  length(texto)

...

where texto is a varchar(200) I pass as a parameter to the function calling.

Any help will help.

Thanks!!!

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql