Re: [SQL] Locale and pattern matching
Hélder M. Vieira wrote: > For instance, if the pattern specifies an uppercase 'A' with an > accute accent, then it will match a lowercase 'A' with an accute > accent, but not an upper or lower case 'A' with a tilde. > This behaviour seems inconsistent with that of the ORDER BY clause, > which considers all forms of a vowel as equal This is not exactly true. Sorting just goes through the strings in multiple passes, looking at the "general" letter first, then at the case, then at the accents, until it finds a difference. > Shouldn't case insensitive pattern matching follow the same collation > weights that ORDER BY uses ? Even if it did, it would not help you, as explained above. Moreover, the collation rules of some locales are sufficiently weird that a consistent behavior between sorting and pattern matching is impossible to achieve. > Until now, I've been selecting LATIN1 encoding, but after a few > tests, I came to think that LATIN9 is a better option (the euro > sign...). For those who regularly use LATIN9, what is your opinion ? > Is it indeed a better option ? Yes. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Help on function creating
Thanks Andrew, Osvaldo ( Obrigado) and Aaron !! Sory Andrew the right version number is 7.4.3 and I'll study the crosstab because it's seems to fit for sutuation. See you... Andrew Sullivan escreveu: > I think you can do this with the contrib/crosstab stuff. But AFAIK, > there's no such thing as Pg 7.5.3. > > A > > On Wed, Dec 07, 2005 at 10:26:53AM -0200, Alexandre Gonçalves Jacarandá wrote: > >>Hello everyone, I'm using postgresql form an year and I have some >>difficult to write a function to make an report. I'm running PostgreSQL >>7.5.3 on i686-pc-linux-gnu (Mandriva 10.1). My table structure is: >>Tabela "public.matricula" >> Column | Type |Modifiers >> >>-+--+- >> id | integer | not null default >>nextval('seq_matricula'::text) >> ref_contrato| integer | >> ref_pessoa | integer | >> ref_campus | integer | >> ref_curso | integer | >> ref_periodo | character varying(10)| >> ref_disciplina | integer | >> ref_curso_subst | integer | >> ref_disciplina_subst| integer | >> ref_disciplina_ofer | integer | >> nota| double precision | default 0 >> nota_exame | double precision | default 0 >> nota_final | double precision | default 0 >> conceito| character varying(5) | default >>''::character varying >> conceito_exame | character varying(5) | default >>''::character varying >> conceito_final | character varying(5) | default >>''::character varying >> >>I need to have an output like: >>ref_pessoa | ref_disciplina1 | ref_disciplina2 | ... | ref_disciplina n >>1 | nota_final1 | nota_final2 | ... | nota_final n >> >>How can I make this ? I know that I need to declare an variable an than >>make an for - loop, but I don't know how. Where can I get some examples >>for this? >>Thanks. >> >>-- >>__ >>Alguns caminham pelo arco, >>eu caminho pela reta. >> >>Alexandre Gonçalves Jacarandá >>Assessor de Tecnologia de Informação >>Tel.: 0 ** 21 8131-2313 >> >> >> >> >> >> >> >>___ >>Yahoo! doce lar. Faça do Yahoo! sua homepage. >>http://br.yahoo.com/homepageset.html >> >> >>---(end of broadcast)--- >>TIP 3: Have you checked our extensive FAQ? >> >> http://www.postgresql.org/docs/faq > > -- __ Alguns caminham pelo arco, eu caminho pela reta. Alexandre Gonçalves Jacarandá Assessor de Tecnologia de Informação Tel.: 0 ** 21 8131-2313 ___ Yahoo! doce lar. Faça do Yahoo! sua homepage. http://br.yahoo.com/homepageset.html ---(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
[SQL] unsubscribe
unsubscribe