Table name as a PostgreSQL function parameter

Before you go there: for only few, known tables names, it’s typically simpler to avoid dynamic SQL and spell out the few code variants in separate functions or in a CASE construct. That said, what you are trying to achieve can be simplified and improved: CREATE OR REPLACE FUNCTION some_f(_tbl regclass, OUT result integer) LANGUAGE … Read more

Using number as “index” (JSON)

JSON only allows key names to be strings. Those strings can consist of numerical values. You aren’t using JSON though. You have a JavaScript object literal. You can use identifiers for keys, but an identifier can’t start with a number. You can still use strings though. var Game={ “status”: [ { “0”: “val”, “1”: “val”, … Read more

Cannot create a database table named ‘user’ in PostgreSQL

user is a reserved word and it’s usually not a good idea use reserved words for identifiers (tables, columns). If you insist on doing that you have to put the table name in double quotes: create table “user” (…); But then you always need to use double quotes when referencing the table. Additionally the table … Read more

What are “connecting characters” in Java identifiers?

Here is a list of connecting characters. These are characters used to connect words. http://www.fileformat.info/info/unicode/category/Pc/list.htm U+005F _ LOW LINE U+203F ‿ UNDERTIE U+2040 ⁀ CHARACTER TIE U+2054 ⁔ INVERTED UNDERTIE U+FE33 ︳ PRESENTATION FORM FOR VERTICAL LOW LINE U+FE34 ︴ PRESENTATION FORM FOR VERTICAL WAVY LOW LINE U+FE4D ﹍ DASHED LOW LINE U+FE4E ﹎ CENTRELINE … Read more

Are PostgreSQL column names case-sensitive?

Identifiers (including column names) that are not double-quoted are folded to lowercase in PostgreSQL. Column names that were created with double-quotes and thereby retained uppercase letters (and/or other syntax violations) have to be double-quoted for the rest of their life: “first_Name” Values (string literals / constants) are enclosed in single quotes: ‘xyz’ So, yes, PostgreSQL … Read more

Hibernate throws org.hibernate.AnnotationException: No identifier specified for entity: com..domain.idea.MAE_MFEView

You are missing a field annotated with @Id. Each @Entity needs an @Id – this is the primary key in the database. If you don’t want your entity to be persisted in a separate table, but rather be a part of other entities, you can use @Embeddable instead of @Entity. If you want simply a … Read more

Is main a valid Java identifier?

public class J { public static void main(String[] args) { String main = “The character sequence \”main\” is an identifier, not a keyword or reserved word.”; System.out.println(main); } } This compiles, and when executed, emits this output: The character sequence “main” is an identifier, not a keyword or reserved word. The character sequence main is … Read more

What is the meaning of single and double underscore before an object name?

Single Underscore In a class, names with a leading underscore indicate to other programmers that the attribute or method is intended to be be used inside that class. However, privacy is not enforced in any way. Using leading underscores for functions in a module indicates it should not be imported from somewhere else. From the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)